C++ is a Metacompiler
summary
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
chapters (9)
- 0:00Introduction and motivation
- 0:56Limitations of C++ loops
- 2:52Introducing intervals
- 5:29Chord DSL demonstration
- 17:55Hustle DSL and performance
- 21:43Philosophy of metacompilers
- 28:44Compiler theory and methods
- 34:40Implementation details
- 48:00Entailment and future outlook








