Building a small Language with Go for fun
summary
Builds a tiny language to add union (sum) types to Go and implements a handwritten top‑down parser (starts from an EBNF attempt and then throws it away) that tokenizes with go/scanner, emits go/ast nodes, and runs the standard go/types checker. Generates Go source, injects imports and helper structs to represent unions, runs the generated code, and uses static analysis on the produced AST to enforce constraints — a working end‑to‑end pipeline.
AI-written summary · about
chapters (6)
- 0:00Start
- 0:23Building a Small Language with Go for Fun
- 10:13Write the Parser
- 11:43For Loops
- 14:41Type Checking
- 22:30Go Parser
related talks
32mBuilding a Beginner's Programming Language with Go
01h 00mHow to write a programming language and shell in Go with 92% test coverage and instant CI/CD
39mIs Go A Good Language to Build Compilers?
43mUnderstanding the Go Compiler
45mHow to Make a Programming Language
41mWriting Open Source Tooling Using AST
59mUnleashing the Go Toolchain
28mModern language engineering with Langium
