Expressive Compile-Time Parsers in C++
summary
Survey of compile‑time parsers compares actual libraries and implementations: Boost.MetaParse, Lexi, ctpg, CT and experimental macro_rules and YP across C++98→C++23, with concrete builds — a compile‑time SQL DSL, a compile‑time JSON tree using a custom compile‑time allocator, and struct/type generators tied to reflection. Claims: parsed DSLs compile into identical assembly (-O1) so there is zero runtime overhead. Measured costs are small (whole demo adds ~1.5s build time), but pathological template expansions can blow compile time and memory (>1 minute, gigabytes) and some constructs fail due to C++ structural type rules.
AI-written summary · about
chapters (17)
- 0:00Introduction
- 1:05Expressive code in C++
- 9:16Compile-time parsing basics
- 11:24Boost MetaParse library
- 16:38Lexi compile-time parser
- 20:14CT compile-time regex
- 24:06CTPG parser generator
- 27:39Macro rules in C++
- 32:59YP parser combinator
- 38:44Compile-time parsing and reflection
- 47:15Nested data member access
- 58:16Type creation with syntax
- 1:01:24JSON tree with compile-time allocator
- 1:05:18Compile-time performance
- 1:08:09Future of compile-time parsing
- 1:15:42Derive macro implementation
- 1:18:05Q&A and closing
related talks
01h 01mExpressive Compile Time Parsers
01h 03mCompile-Time Regular Expressions
53m“Parsing C++”
59mThe Power Of Compile-Time Resources
01h 10m“constexpr ALL the Things!”
01h 01m“How bad is Meta-Programming still today?"
46mWhat FP Can Learn From Static Introspection
51mCompile-time tools supporting generic programming in C++
