C++26 gives us reflection, the culmination of decades of work building up support for more and more compile-time programming in C++. But reflection primarily only lets us *observe*. The important next question is: what might it look like if we were to *generate*?
This talk is not a pitch for a specific direction for any particular future C++ standard, but rather a tour of the design space of source code generation for C++. We have some options for code generation today — macros and templates. Where do they hit their limits? What can we learn from our peers in the programming language world — like Rust, Swift, and D? Is there any low-hanging fruit to be found?
There are many facets to consider: capability, composability, cohesion, debuggability, ergonomics, error quality, teachability, tooling. The goal of this talk is to leave with better instincts — and better questions — for evaluating source code generation for C++ as reflection moves from novelty to foundational.
View Slides
Barry is a senior C++ developer at Jump Trading in Chicago, a technology and engineering-driven trading firm. After programming for many years, he got really into the nuances and intricacies of C++ by being unreasonably active on StackOverflow (where he is the top contributor in every standard from C++14 up through C++26). A lot of his C++ knowledge comes from just answering questions that he doesn’t know the answers to, especially when he answers them incorrectly at first.
His C++ involvement escalated when he started attending standards committee meetings in 2016, having written dozens of papers for C++20, C++23, and now C++26. You might know him from such features as deducing this, explicit(bool), conditionally trivial special member functions, if consteval, packs in structured bindings, and now, reflection.
Outside of the C++ world, Barry is an obsessive swimming fan. He writes fun data articles for SwimSwam, which led him to be able to do work with a briefly-existing professional swim team (the DC Trident). He also periodically gets to interview a bunch of Olympians.