CppCon 2017: Herb Sutter “Meta: Thoughts on generative C++”
CppCon2 HN recommenders · recommended in 2 months, 2017-2020
105K views · 9 years ago · talk · dated
At CppCon 2017 Herb Sutter presents his work on evolving C++ through compile-time code generation, including metaclasses and reflection. The aim is to make the language both more powerful and simpler by letting programmers express intent directly.
Praised as the best talk of CppCon 2017 and the key introduction to metaclasses and generative C++.
1:54:00Can C++ be 10x Simpler & Safer? - Herb Sutter - CppCon 2022
CppCon
277K views • 3 years ago
1:29:06CppCon 2015: Herb Sutter "Writing Good C++14... By Default"
CppCon
193K views • 11 years ago
1:40:27CppCon 2014: Herb Sutter "Back to the Basics! Essentials of Modern C++ Style"
CppCon
323K views • 12 years ago
1:33:12De-fragmenting C++: Making Exceptions and RTTI More Affordable and Usable - Herb Sutter CppCon 2019
CppCon
90K views • 7 years ago
1:39:25CppCon 2016: Herb Sutter “Leak-Freedom in C++... By Default.”
CppCon
149K views • 10 years ago
54:48CppCon 2018: Hana Dusíková “Compile Time Regular Expressions”
CppCon
14K views • 8 years ago
1:04:00CppCon 2015: Sean Parent "Better Code: Data Structures"
CppCon
106K views • 11 years ago
1:33:022013 Keynote: Chandler Carruth: Optimizing the Emergent Structures of C++
CppNow
34K views • 13 years ago
1:21:13C++ and Beyond 2012: Herb Sutter - atomic Weapons 1 of 2
alexsmail
71K views • 9 years ago
1:29:54CppCon 2015: Chandler Carruth "Tuning C++: Benchmarks, and CPUs, and Compilers! Oh My!"
CppCon
188K views • 11 years ago
1:31:14CppCon 2017: Titus Winters “C++ as a "Live at Head" Language”
CppCon
53K views • 9 years ago
1:19:52CppCon 2016: Jason Turner “Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17”
CppCon
264K views • 10 years ago
59:58CppCon 2018: Nicolai Josuttis “The Nightmare of Initialization in C++”
CppCon
79K views • 8 years ago
57:39CppCon 2016: Chandler Carruth “Garbage In, Garbage Out: Arguing about Undefined Behavior..."
CppCon
94K views • 10 years ago
1:15:46CppCon 2017: Matt Godbolt “What Has My Compiler Done for Me Lately? Unbolting the Compiler's Lid”
CppCon
178K views • 9 years ago
1:36:27CppCon 2016: Dan Saks “extern c: Talking to C Programmers about C++”
CppCon
175K views • 10 years ago
55:42CppCon 2019: Matt Godbolt “Path Tracing Three Ways: A Study of C++ Style”
CppCon
77K views • 7 years ago
1:32:33C++ and Beyond 2012: Herb Sutter - atomic Weapons 2 of 2
alexsmail
29K views • 9 years ago
1:04:26CppCon 2018: G. Nishanov “Nano-coroutines to the Rescue! (Using Coroutines TS, of Course)”
CppCon
40K views • 8 years ago
1:06:00CppCon 2017: Juan Pedro Bolivar Puente “Postmodern immutable data structures”
CppCon
31K views • 9 years ago
4 comments from Hacker News
To a degree, but templates and constexpr don't support a bunch of features like compile-time field enumeration and introspection + code generation. For example, let's say I have a bunch of structs: struct GeoCoordinate { int lat, long; }; struct GeoArea { std::vector<GeoCoordinate> perimeter; }; struct Place { std::string name; std::string contact_number; GeoArea area; }; Now I need to serialize these structs into a format to be sent over the wire. Currently, I have a few choices: 1. Use an off-the-shelf library like protobuf (disclaimer: I work for Google). Then I have to convert my code to a protobuf definition and rely on its code generator to perform [de]serialization. I also have to hope that my library supports all the field definitions I need. 2. Write macros to define each field in each structure. These macros perform some arcane magicks that somehow create the necessary [de]serialization functions. These macros are difficult to write and maintain (or I find a library). 3. Manually define the methods myself. This is tedious, hard to maintain, and error prone. What if I could write some code in C++ which could read the structure and generate the appropriate serialization code? Something like (syntax hypothetical): Serializable(Class) { std::string serialize() { std::string output; for (auto member : Class.members()) { // loop unrolled at compile time if (member.type == int) { output.append(std::format("{:10}"), member.get()) } else if (member.type == std::string) { ...
A few years ago Herb Sutter proposed Python-like metaclasses in C++ through compile-time code generation. Not sure if anything has been proposed for general use. ▶ this video
The talk about the reflection proposal was amazing. Meta classes are also very cool. We can only hope it comes fast. ▶ this video
Herb Sutter's talk about it is by far the best talk I've seen from from CppCon17. "Meta: Thoughts on generative C++" - ▶ this video