Playlist | schedule page slides as PDF |
Encoding 1 — let as fun (2:24)
Local bindings via let can be implemented by making Moe’s parse convert it into an immediately applied fun form. See just_lambda.rhm.
Encoding 2 — sugar, libraries, and expressiveness (4:27)
Converting let to fun 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:25)
We can encode a multi-argument function as single-argument functions by currying.
Encoding 4 — booleans (2:48)
Encoding booleans and conditionals using just functions.
Encoding 5 — pairs (3:10)
Encoding pairs using just functions.
Encoding 6 — λ-calculus (1:20)
The λ-calculus is an even simpler language than Moe. It’s a Turing-complete language that was invented by Alonzo Church in the 1930s.
Encoding 7 — Church numerals (2:15)
Numbers can be encoded as functions. We look at a particular encoding known as Church numerals.
Encoding 8 — more arithmetic (5:15)
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 (2:12)
Summing up our exploration of λ-calculus encodings so far.