Inventing a language (placeholder title)
summary
A step‑by‑step recipe for a working interpreter: source code → AST → pattern‑matching evaluator written in Scala, implementing numbers, addition, booleans and if‑then‑else with short‑circuiting, local let bindings with lexical scope, an environment stack, functions-as-values stored as closures (captures defining environment) and application semantics. Demonstrates eager evaluation, runtime type errors for bad ops, fixes a closure bug that initially produced 5 instead of 4, and notes adding recursion and static type checking next.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 4:47Substitution model
- 9:36Number and addition
- 17:19Conditionals
- 25:16Variables
- 31:19Expressions
- 35:06Bindings
related talks
37mProgramming a Language
42mFunctional interpreters and you
44mFunctional Interpreters and You
01h 00mHow to create a new JVM language
45mHow to Make a Programming Language
18mHow to Build an Interpreter in 25 Minutes or Less
15mA Principled Approach to REPL Interpreters
26mAn Independent History of Implicit Language Application
