Parsing, Compiling, and Static Metaprogramming
summary
Shows concrete wins and code you can copy: using parsers to add logging to every function automatically, to run presubmit style checks and catch underscore vs camelCase errors, and to extract strings that need translation. Demonstrates building a tiny compiler with a PEG grammar that turns a Smalltalk‑style variable syntax into runnable JavaScript in minutes and explains the exact parse tree edits and code‑generation steps used so the transformations actually work.
AI-written summary · about
chapters (21)
- 0:00Introduction
- 1:27What is a compiler
- 2:13Parser and Code Generator
- 3:18SPrema
- 4:47Parsing Tree
- 5:59Code
- 7:26Sample Code
- 10:15Parse Tree
- 11:21Compiling Example
- 13:35ContextFree Grammar
- 16:06Parsing arithmetic
- 16:56Left recursion
- 18:37Nested arrays
- 19:26PegJS
- 20:28Snippet Code
- 21:45Arithmetic
- 22:55Multiple Expressions
- 23:26Parse
- 24:22Variable Declarations
- 25:11Clean Up
- 26:00Conclusion
related talks
31mJavaScript Compilers For Fun and Profit
29mMy Little Parser: Tooling is Magic
26mMake Your Own Programming Language!
28mHow to Build a Compiler
28mFantastic ASTs and where to find them
22mHow Linters, Compilers & Other Cool Things Work
44mJavaScript AST programming: Introduction and beyond
33mEmbracing Black Magic: The Power of Code Transpilation
