|Playlist||schedule page slides as PDF|
Encoding 1 — let as lambda (1:50)
Local bindings via let can be implemented by making Curly’s parse convert it into an immediately applied lambda form. See just-lambda.rkt.
Converting let to lambda is an example of a more general concept of syntactic sugar, and even more generally as an encoding of a new construct in in terms of existing constructs.
Encoding 3 — currying (1:20)
We can encode a multi-argument function as single-argument functions by currying.
Encoding 4 — booleans (2:30)
Encoding booleans and conditionals using just functions.
Encoding 5 — pairs (3:28)
Encoding pairs using just functions.
Encoding 6 — λ-calculus (1:28)
The λ-calculus is an even simpler language than Curly. It’s a Turing-complete language that was invented by Alonzo Church in the 1930s.
Encoding 7 — Church numerals (4:11)
Numbers can be encoded as functions. We look at a particular encoding known as Church numerals.
Encoding 8 — more arithmetic (6:58)
Implementing additional numeric operations for Church numerals. It’s ok if you don’t get all the details, as long as you get the general idea that numbers can be encoded in functions just as well as they can be encoded in bit patterns.
Encoding 9 — conclusion (1:26)
Summing up our exploration of lambda-calculus encodings so far.