~/talk

Expressive Compile Time Parsers

Talkat Meeting C++ 2023 · 2023-11-12..11-14· [compilers-and-language-design]
name:Alon Wolf
links:none on file
slides:none on file

Claim is that compile time parsers let C++ accept custom DSLs with zero runtime overhead by moving parsing into constexpr and using existing compilers. The talk compares libraries boost metaparse, Lexi, CTRE, ctpg, macro_rules, ycp, shows techniques like constexpr strings, LL1/LR1 tables as bitsets, and reflection via resolve_identifier. It builds SQL->lambda, typescript-like struct generator, and compile-time JSON with a fixed allocator that works but requires compile-time input and structural public members; benchmarks show 14 seconds for 1,000 structs and ~1.5s rebuild diff.

AI-written summary · about

  1. 0:00Introduction
  2. 1:25What is a parser
  3. 3:14Expressiveness in C++ and DSLs
  4. 6:10Compile-time vs runtime parsing
  5. 9:19Boost.MetaParse
  6. 13:57Lexi: C++17 parser combinators
  7. 17:09CTRE: C++17 regex
  8. 20:23CTPG: C++17 LR(1) parser
  9. 24:02MacroRules: C++23 Rust macros
  10. 27:38Custom compile-time parser library
  11. 30:28Reflection and compile-time parsing
  12. 33:43Nested data member access
  13. 37:45Extending syntax with operators
  14. 44:02Creating types from strings
  15. 46:12Compile-time JSON tree
  16. 49:02Choosing the right library
  17. 51:09Compile-time error handling
  18. 52:33Compile-time performance
  19. 55:43Future of compile-time parsing
  20. 57:29Closing remarks and Q&A
~/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.