Python ships a ready-made frontend for your compiler
summary
Shows how to build compilers and DSL compilers in Python by reusing Python’s own syntax so you avoid separate lexing/parsing. Demonstrates using the standard ast module and the match/case pattern-matching syntax to implement everything from simple static analyzers to more complex DSL compilers.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:46Compilers for everyone
- 4:17Pattern matching in Python
- 8:12Code formatting with AST
- 9:16Expression simplification
- 10:42Stack code generation
- 12:28Python AST module
- 15:40AST visualization
- 17:07DSL for graphs compilation
- 22:40Datalog language implementation
- 32:10Control flow graph
- 37:27Static code analysis
- 41:44WebAssembly compilation
- 45:11Recommendations and conclusion








