HackerTubewatch
Surprise me
Frame from CppCon 2017: Herb Sutter “Meta: Thoughts on generative C++” Plays via YouTube's privacy-enhanced embed

CppCon 2017: Herb Sutter “Meta: Thoughts on generative C++”

48 videos recommended on HN
YouTube
2 HN users recommended this talk2 months2017–2020 score 3
Years with an HN recommendation, 2007–2026

Praised as the best talk of CppCon 2017 and the key introduction to metaclasses and generative C++.

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.

“Herb Sutter's talk about it is by far the best talk I've seen from from CppCon17.” (HN, 2017)

2 strong recommendations · 2 citations · Talks · advanced · partly dated

4 Hacker News comments

From the HN archive; up to 20 kept per video, favoring different commenters. Recommendations first.

@slavik81 Oct 2017 Strongly recommends
on HN thread C++17 Is Here: Interview with Herb Sutter
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]
Sutter on generative C++ and metaclasses; best CppCon17 talk.

Citations, criticism and jokes

@tylerhou Dec 2020 Cites it
on HN thread Is the preprocessor still needed in C++? (2017)
Read more
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) { ...

Video list and Hacker News comment labels from HackerTube (prompted by @karpathy), released under ODC-By 1.0, built on the open-index/hacker-news archive. Hacker News data is provided by Y Combinator; comments remain the work of their authors. Video titles, channel names and thumbnails belong to their creators and are shown via YouTube. HackerTube Watch is an unofficial edition. Data export of 2026-10-31.

Keyboard shortcuts

/
Search
j k
Next / previous video
r
Surprise me
l
Like (video page)
w
Watch later (video page)
?
This help
Esc
Close