Lazy 1 — intro (4:37)
PLAI§17.1 Motivating lazy evaluation, as opposed to eager evaluation.
Lazy 2 — demo (6:33)
Demonstrating lazy evaluation in Racket via the plai-lazy language.
Lazy 3 — reinterpret (6:07)
Running our old interpreters (with minimal changes) in a lazy variant of Racket. The changes just strip away type declarations and/or replace them with run-time predicates, since plai-lazy is untyped. See lambda-u.rkt, letrec-u.rkt, and letrec-mc-u.rkt.
Lazy 4 — interp intro (2:13)
Introduction to a lazy variant of our language, starting with lambda.rkt, and adding just an example (i.e., test case) for laziness.
Lazy 5 — interp (2:41)
Using a lazy host language to get laziness is easy, but it doesn’t tell us much. Instead, we introduce delay and adjust the environment to hold delayed expressions. See lazy.rkt.
Thanks to Julien Provillard for greatly improving the presentation and implementation here.
Lazy 6 — call-by-need (4:41)
Our implementation of a lazy language turns out to be unrealistic, but the problem can be fixed by caching the value of a suspended expression, so that it can be used if the value is demanded again. See more-lazy.rkt.
Lazy 7 — terminology (1:47)
A brief summary of terminology that you may encounter related to lazy and eager evaluation.