Expressive Compile Time Parsers
summary
Shows that compile-time parsers work in real C++: Boost.Metaparse (C++98/11 tricks) to build compile-time strings, lexi (C++17) for composable parser combinators, CTRE for compile-time regex with zero runtime overhead and runtime performance on par with Boost.Regex and faster than std::regex. Demonstrates an SQL-like literal that compiles to a lambda, a dot-path DSL that generates identical assembly to hand-written code, and a CTLR parser generator (ctpg) for LR1 tables; compile-time cost rises but simple syntaxes stay practical.
AI-written summary · about
chapters (11)
- 0:00Introduction and motivation
- 2:13Domain specific languages
- 5:04Boost.Metaparse overview
- 8:39Lexi library introduction
- 10:51Compile Time Regex library
- 13:19CTPG parser generator
- 15:28Macro.Rules library
- 17:14Reflection and compile time parsers
- 23:47Zero-overhead abstractions
- 26:00Future of compile time parsing
- 27:24Q&A session
