Skip to content

Course

Writing Compilers & Interpreters

Language implementation from first principles — lexing, parsing, AST design, interpretation, bytecode compilation, and the engineering discipline behind a language that real people can debug.

9 lessons

Course Q&A

Reviews

Enrolled members can rate this course.

No reviews yet.

Front End of a Language

Lexing, parsing, and ASTs — turning source text into structure without losing your mind.

  1. 01Lexing: From Bytes to TokensWhat a lexer really buys you, how to tokenize without regex spaghetti, and why source locations are non-negotiable.22mOpen
  2. 02Parsing with Recursive DescentBuild a parser humans can read: precedence, associativity, lookahead, and why panic-mode recovery beats one-shot failure.25mOpen
  3. 03AST Design: Structure Worth KeepingDesign abstract syntax trees that carry truth forward: what belongs in the tree, what does not, and how semantic validation stays sane.24mOpen

Interpreters That Behave

Evaluation, environments, closures, and runtime errors that explain themselves.

  1. 01Tree-Walking Interpreters: Evaluation as a Recursive WalkImplement direct AST evaluation with explicit values, control flow, and predictable failure behavior before worrying about speed.26mOpen
  2. 02Environments, Scope, and ClosuresThe environment chain model behind lexical scope, mutable bindings, first-class functions, and the closure bugs everyone hits once.27mOpen
  3. 03Runtime Errors and DebuggabilityMake failures useful: stack traces, source spans, error taxonomy, and the interpreter instrumentation users will thank you for.21mOpen

Compilation and Real Implementations

Bytecode, virtual machines, performance, and shipping a small but honest language.

  1. 01Bytecode Compilation: Lowering Trees into InstructionsTranslate ASTs into linear bytecode, model a stack machine, and understand what compilation actually changes.28mOpen
  2. 02Virtual Machines: Representation and PerformanceWhy bytecode VMs are faster, where the time actually goes, and which optimizations are worth doing before a JIT is even a conversation.25mOpen
  3. 03Shipping a Small LanguageTurn an interpreter or bytecode VM into a usable implementation: CLI, tests, documentation, versioning, and a realistic project architecture.23mOpen