Highlighting C++ with C++ is… Hard
summary
A static C++ highlighter is built with heavy template metaprogramming, a Boost.Spirit-like parser implemented in templates to emit color spans, and the project hits compiler limits: MSVC 2017 rejects declarations when symbol names inflate to ~4,500 characters (or ~218 in clang), top-level grammar name expands to ~2,000+ chars and can blow up to ~300,000 after instantiation, Itanium ABI produces shortest names, compile time for one file drops from ~1 minute to ~30s after hiding grammars in lambdas, and object size reaches 50 KB+ (65 KB MSVC, 90 KB GCC).
AI-written summary · about
related talks
01h 39m“Thoughts on a more powerful and simpler C++ (5 of N)”
45mC++ is a Metacompiler
53mPruning Error Messages From Your C++ Template Code
01h 34mMetaprogramming in C++14
57mIntroduction to C++ Template Metaprogramming
51mCompile-time tools supporting generic programming in C++
01h 48m“Meta: Thoughts on generative C++”
01h 04mC++ Insights: Peek behind the curtains of your C++ compiler
