Programming a Language
summary
Builds an interpreter (not a parser) in Scala that starts from numbers and addition and grows into booleans, if/else, AST as a recursive sum type, let-bindings implemented with an environment-as-stack using eager evaluation, and functions implemented as values that close over their defining environment. Examples run and match the formal rules: 2+3 → 5, if true then 1 else 2 → 1, lexical scoping yields 3 not 4, function application yields 4. Error cases produce runtime type errors.
AI-written summary · about
chapters (8)
- 0:00Creating a programming language
- 2:27What is a programming language
- 4:31AST for source code
- 11:53Adding conditionals
- 18:38Variable bindings
- 24:55Lexical scoping and environments
- 28:48Functions as values
- 35:13Key takeaways








