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 approach (1:49)
Considering some different ways that we could implement laziness. Using a lazy host language is easy, but it doesn’t tell us much. Instead, we introduce suspendV as a new kind of “value.”
Lazy 6 — interp and suspendV (3:05)
Adding and using suspendV, and discovering the need for strict.
Lazy 7 — interp and strict (1:46)
Looking at examples for strict.
Lazy 8 — interp completion (4:01)
Finishing the interpreter with strict. See lazy.rkt.
Lazy 9 — call-by-need (4:52)
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 10 — terminology (1:47)
A brief summary of terminology that you may encounter related to lazy and eager evaluation.