Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Lazy evaluation
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Performance== The number of beta reductions to reduce a lambda term with call-by-need is no larger than the number needed by call-by-value or [[call-by-name]] reduction.<ref>{{cite book |last1=Niehren |first1=Joachim |title=Proceedings of the 23rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages - POPL '96 |chapter=Functional computation as concurrent computation |date=1996 |pages=333β343 |doi=10.1145/237721.237801 |isbn=0897917693 |s2cid=7332050 |url=https://hal.inria.fr/inria-00536819/file/POPL96.pdf |chapter-url=https://publikationen.sulb.uni-saarland.de/bitstream/20.500.11880/25024/1/RR_95_14.pdf}}</ref><ref>{{cite journal |last1=Niehren |first1=Joachim |title=Uniform confluence in concurrent computation |journal=Journal of Functional Programming |date=September 2000 |volume=10 |issue=5 |pages=453β499 |doi=10.1017/S0956796800003762 |s2cid=66013 |url=https://hal.inria.fr/inria-00536801/document |access-date=7 January 2022}}</ref> And with certain programs the number of steps may be much smaller, for example a specific family of lambda terms using [[Church numeral]]s take an infinite amount of steps with call-by-value (i.e. never complete), an exponential number of steps with call-by-name, but only a polynomial number with call-by-need. Call-by-need embodies two optimizations - never repeat work (similar to call-by-value), and never perform unnecessary work (similar to call-by-name).<ref name=Stelle>{{cite thesis |last1=Stelle |first1=George Widgery |title=Shared-Environment Call-by-Need |date=July 2019 |url=https://digitalrepository.unm.edu/cgi/viewcontent.cgi?article=1099&context=cs_etds#page=23 |access-date=8 January 2022|publisher=University of New Mexico|type=PhD|pages=11β12}}</ref> Lazy evaluation can also lead to reduction in [[memory footprint]], since values are created when needed.<ref name="Smith2009">{{cite book|author=Chris Smith|title=Programming F#|url=https://books.google.com/books?id=gzVdyw2WoXMC&pg=PA79|access-date=31 December 2010|date=22 October 2009|publisher=O'Reilly Media, Inc.|isbn=978-0-596-15364-9|page=79}}</ref> In practice, lazy evaluation may cause significant performance issues compared to eager evaluation. For example, on modern computer architectures, delaying a computation and performing it later is slower than performing it immediately. This can be alleviated through [[strictness analysis]].<ref name=Stelle/> Lazy evaluation can also introduce [[memory leak]]s due to unevaluated expressions.{{sfn|Launchbury|1993}}<ref>Edward Z. Yang. [http://blog.ezyang.com/2011/05/space-leak-zoo/ "Space leak zoo"].</ref>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Lazy evaluation
(section)
Add topic