Playlist | schedule page slides as PDF |
Lazy 1 — intro (4:41)
PLAI§17.1 Motivating lazy evaluation, as opposed to eager evaluation.
Lazy 2 — using lazy Shplait (3:07)
Demonstrating lazy evaluation via Shplait’s ~lazy mode.
Lazy 3 — state and laziness (1:34)
An illustration of problem of mixing state and lazy evaluation, with the conclusion that a lazy language should be purely functional.
Lazy 4 —
Running the lambda.rhm interpreter in Shplait’s lazy mode, which turns Curly into a lazy language.
Lazy 5 —
Running the letrec-ubi.rhm interpreter in Shplait’s lazy mode, which doesn’t work, since the interpreter implementation uses state. The repair is to get rid of state in the implementation and double down on laziness; see letrec_mc_lazy.rhm.
Lazy 6 — lazy interp (3:25)
Instead of relaying on Shplait’s lazy mode, we introduce delay and adjust the environment to hold delayed expressions. See lazy.rhm.
Thanks to Julien Provillard for greatly improving the presentation and implementation here.
Lazy 7 — more lazy (2:36)
Our implementation of a lazy language turns out to be unrealistic, because it evaluates expressions multiple times.The problem can be fixed by caching the value of a delayed expression, so that the cached value can be used if it is demanded again. See more-lazy.rkt.
Lazy 8 — terminology (0:56)
A brief summary of additional terminology that you may encounter related to lazy and eager evaluation.