Playlist | schedule page slides as PDF |
Object 1 — datatype-oriented vs. object-oriented (3:33)
PLAI§10, more or less. See also OOPLAI. Introduces the concepts of datatype-oriented programming and object-oriented programming, and explains how both relate to functional programming.
Object 2 — objects as functions (2:43)
Shows a simplistic encoding of objects as functions, illustrating what it means to treat variants and operations in an object-oriented way (even in a language without “objects”).
Object 3 — Envs as objects (3:08)
Uses the function encoding of objects to change the treatment of environments in our interpreter from datatype-oriented style to object-oriented style. This is the beginning of a sequence that builds up the core elements of the “object” concept, but doing so in terms of functions.
Object 4 — Exps as objects (4:35)
Converting Exp to objects. See lambda_clos.rhm.
Object 5 — objects as lists (4:05)
The simplistic object encoding supports only a single operation (i.e., a single method) in each object. We can use a table of functions (using a list of tuples) to support module operations (methods), but we have to switch to untyped Shplait.
Object 6 — Value
s as objects (5:44)
Converting Value to objects, using the new hash-table encoding. See lambda_find.rhm.
Object 7 — objects as fields plus methods (3:08)
The final encoding of objects, which avoids higher-order functions by explicitly representing a table of field and a table of methods in each object. The point of avoiding higher-order functions is that we can have a simpler core for just objects without functions—but the encoding starts to get complex.
Object 8 — object macro (3:08)
Syntactic sugar for the fields-and-methods representation of objects. This sugar provides syntax in Shplait that matches the syntax that we’re about to implement as object-oriented Moe. See object_demo.rhm. See also lambda_obj.rhm, which is the object-oriented interpreter using this syntactic form.
Object 9 — object-oriented Moe (4:17)
Introduces object-oriented Moe, which has objects (and field access and method calls) and not functions (or function calls).
Object 10 — expressiveness (2:18)
An aside showing why our new Moe is just as expressive as the one with functions: both are Turing-complete.
Object 11 — interp examples (6:54)
The new Moe grammar and some examples to explore how interp should work.
Object 12 — interp (4:08)
Implementation of interp for object-oriented Moe. See object.rhm.