My First Language Frontend with LLVM (Kaleidoscope Tutorial)
LLVM Project
LLVM's official ten-chapter tutorial builds Kaleidoscope in roughly 1,000 lines: lexer, recursive-descent parser with operator precedence, LLVM IR generation, a JIT, control flow, mutable variables, object-file emission and DWARF debug information.
More resources on Compilers & Interpreters
Writing a C Compiler: Build a Real Programming Language from Scratch
A guided project in 792 pages: compile the smallest valid C program to x64 assembly, then add one language feature per chapter through types, pointers, structs and dynamic memory. Uses language-agnostic pseudocode plus a public open-source test suite.
Engineering a Compiler (3rd Edition)
Cooper and Torczon's 848-page textbook treats each compiler pass as an engineering problem with explicit tradeoffs: scanning, parsing, semantic elaboration, intermediate representations, SSA-based optimisation, instruction selection, scheduling and register allocation. Third edition adds chapters on runtime naming and code shape.
Cornell CS 6120: Advanced Compilers (Self-Guided)
Adrian Sampson's PhD-level course, released for self-study with videos, notes, assigned papers and implementation tasks. Fourteen lessons cover intermediate representations, dataflow analysis, SSA, loop optimisation, alias analysis, memory management and JIT compilation, using LLVM and the teaching IR Bril. Bril keeps implementation tasks tractable in any language while the LLVM tasks touch a production toolchain.
Stanford CS143: Compilers
Stanford's undergraduate compilers course, with public lecture slides, written assignments and solutions, and five programming assignments that build a working compiler for Cool, a small object-oriented language, targeting MIPS assembly.
Crafting Interpreters
Robert Nystrom builds the Lox language twice: first a tree-walking interpreter in Java, then a bytecode virtual machine in C, covering scanning, parsing, resolution, closures, classes and garbage collection. The complete text is free online.
