~/talk

Expressive Compile-Time Parsers in C++

Talkat C++Now 2024 · 2024-04-29..05-03· [compilers-and-language-design]
name:Alon Wolf
links:none on file
slides:none on file

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

  1. 0:00Introduction
  2. 1:05Expressive code in C++
  3. 9:16Compile-time parsing basics
  4. 11:24Boost MetaParse library
  5. 16:38Lexi compile-time parser
  6. 20:14CT compile-time regex
  7. 24:06CTPG parser generator
  8. 27:39Macro rules in C++
  9. 32:59YP parser combinator
  10. 38:44Compile-time parsing and reflection
  11. 47:15Nested data member access
  12. 58:16Type creation with syntax
  13. 1:01:24JSON tree with compile-time allocator
  14. 1:05:18Compile-time performance
  15. 1:08:09Future of compile-time parsing
  16. 1:15:42Derive macro implementation
  17. 1:18:05Q&A and closing
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.