Course · 6 lessons ~55 hr Advanced

Compilers & Interpreters — Building Languages

Compilers & Interpreters — Building Languages covers: Crafting Interpreters, Writing An Interpreter In Go, Nand2Tetris. Understand how programming languages are implemented: lexing, parsing, ASTs, type checking, code generation, and optimization. Build an interpreter and understand how Ruby's own compiler works. Every erb template is compiled. Rails compiles ERB to Ruby code (string interpolation), which is then compiled to YARV bytecode. The template compiler is a mini-compiler with its own lexer and code generator. Ruby's parser (parse.y) is a LALR parser generated by Bison. After this module, you can read parse.y and understand why certain syntax errors produce the messages they do. YJIT is a JIT compiler built into CRuby (by Shopify). It monitors which methods are called frequently ("hot"), compiles their YARV bytecode to native x86-64/ARM64 machine code, and patches the call sites. After this module, you understand every step of that pipeline.

reading · we frame, you read MIT or the canonical taught · we author, no canonical fits ↺ spirals back to earlier lessons
Course locked

Complete Theory of Computation — Languages & Machines first.

This course unlocks once you've finished its prerequisite. Open prerequisite →

6 lessons. Read in order; spiral back when you need to. By the end you'll have used the core ideas twice — once on the abstract, once on something you'll meet at work next week.