home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / function / 967 < prev    next >
Encoding:
Text File  |  1992-07-27  |  1.4 KB  |  31 lines

  1. Newsgroups: comp.lang.functional
  2. Path: sparky!uunet!munnari.oz.au!bunyip.cc.uq.oz.au!marlin.jcu.edu.au!coral.cs.jcu.edu.au!farrell
  3. From: farrell@coral.cs.jcu.edu.au (John Farrell)
  4. Subject: Re: ** LAZY LANGUAGES FASTER?? **
  5. Message-ID: <farrell.712286497@coral.cs.jcu.edu.au>
  6. Sender: news@marlin.jcu.edu.au (USENET News System)
  7. Organization: James Cook University
  8. References: <1992Jul24.134857.23289@gdstech.grumman.com> <3737@svin02.info.win.tue.nl>
  9. Date: 28 Jul 92 01:21:37 GMT
  10. Lines: 19
  11.  
  12. In <3737@svin02.info.win.tue.nl> erik@wsinfo03.win.tue.nl (Erik Poll) writes:
  13. >david@gdstech.grumman.com (David Nettles) writes:
  14. >>My intuition says that a lazy language would be a lot faster than an
  15. >>eager language simply because the eager language evaluates all of its
  16. >>arguements regardless of whether they are all needed by the function.
  17.  
  18. >Lazy evaluation does indeed save time by not evaluating arguments
  19. >that are not needed. However, eager evaluation saves times by never
  20. >evaluating the same argument twice.
  21.  
  22.   *Non-strict* evaluation saves time by not evaluating arguments which are not
  23. needed. *Lazy* evaluation saves time by evaluating each argument at most once.
  24. Eager evaluation evaluates each argument exactly once.
  25.  
  26.   It is the mechanism by which lazy evaluation is implemented which slows it
  27. down. The speedup due to not evaluating arguments is often negligible because
  28. mostly people don't write functions which don't use their arguments.
  29.  
  30. John
  31.