Metaprogramming in Rust
summary
Explains using Rust procedural macros to embed a parser-combinator language directly in Rust rather than using an external DSL; covers how procedural macros work and how they were applied to simplify writing parser combinators in Rust.
AI-written summary · about
chapters (19)
- 0:00Introduction
- 1:10What is metaprogramming
- 6:01Metaprogramming approaches
- 6:21Macros in Rust intro
- 7:43List comprehensions
- 16:23Formalizing comprehensions
- 18:48Declarative macros
- 21:40For comprehension with macros
- 26:14Recursive macro impl
- 30:56Procedural macros deep dive
- 33:02AST parsing and manipulation
- 37:40Parser for comprehensions
- 40:13Token stream generation
- 42:19Assembling macro pipeline
- 43:23Compile-time code execution
- 44:04Practical DSL example
- 46:09Bootstrapping parsers
- 47:59Choosing macro approaches
- 48:42Conclusion
