~/talk

C++ is a Metacompiler

Talkat CppNorth 2024 Β· 2024-07-21..07-24Β· [c-and-cpp]
links:none on file
slides:none on file

Claim: C++17 can act as a compile-time compiler by parsing DSLs embedded in string literals and emitting constexpr functions. Implementation uses pure C++17 metaprogramming (no std), a CCTMP library (~20k LOC total, ~1.5k LOC across 56 indexed continuation-constructing machines) and a consteval/constexpr+template pipeline to turn Hustle/Cord source into meta-assembly and then into callable constexpr. Results: nontrivial examples (factorial, Newton sqrt, closures, intervals) compile and run; compile-time overhead versus hand-written C++: GCC 0.1s β†’ 0.39s, Clang 0.114s β†’ 0.842s. C++17 string-literal DSLs CCTMP (continuation constructing TMP)

AI-written summary Β· about

  1. 0:00Introduction and motivation
  2. 0:56Limitations of C++ loops
  3. 2:52Introducing intervals
  4. 5:29Chord DSL demonstration
  5. 17:55Hustle DSL and performance
  6. 21:43Philosophy of metacompilers
  7. 28:44Compiler theory and methods
  8. 34:40Implementation details
  9. 48:00Entailment and future outlook
~/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.