15 January 2007
Lampson: Lazy and Speculative Execution
3
Lazy Evaluation
nWell studied in programming languages
oThough not much used
oLazy vs. eager/strict
oExamples:
▬Algol 60 call by name
▬Lazy is the default in Haskell
▬By hand: wrap the lazy part in a lambda
oAffects semantics
▬Side effects—usually not allowed
▬Free variables, e.g. in call by name
▬Termination even in purely functional languages