~/talk

Writing a compiler from scratch

Talkat NDC Oslo 2026 · 2026-09-14..09-18· [compilers-and-language-design]
links:none on file
slides:none on file

Live builds a working compiler for a tiny dynamic language that supports integers, addition, multiplication and variables and finishes by running compiled code on a simple VM. It implements lexing into tokens, a recursive‑descent parser that handles operator precedence correctly, and a compiler that emits five instructions (load int, load var, store var, add, multiply). Variables compile to byte-sized indexes and a stack-based VM executes immediate instructions; the demo compiles and runs examples (e.g. x=3; 1+23 yields 17). Recursive descent parsing* and eager matching are shown in code.

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 1:12Why build a compiler
  3. 5:32Compiler phases overview
  4. 8:03Building the scanner
  5. 19:20Parsing tokens into tree
  6. 25:42Recursive descent parsing
  7. 31:25Parsing expressions
  8. 43:03Parsing assignments
  9. 45:32Compilation targets
  10. 50:07Compiling to bytecode
  11. 53:58Executing bytecode
  12. 56:32Handling variables
  13. 1:00:23Final demo and tips
~/search
type to search 6,518 conferences, 143,918 speakers and 192,133 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.