CppCon 2017: Herb Sutter “Meta: Thoughts on generative C++”
Channel:CppCon · Length:1:47:44 · Published:2017-09-28 · Views:104541
Summary
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.
Why HN recommends it
Praised as the best talk of CppCon 2017 and the key introduction to metaclasses and generative C++.
Herb Sutter's talk about it is by far the best talk I've seen from from CppCon17. — HN, 2017
Programming language design · C, C++, Rust, Go & systems languages
Subtitles (excerpt)
- Thank you, Don. (audience applauding) Just before we get started, thank you very much to over 70 people who responded to this challenge before the Monday night cutoff. That made it very hard to pick winners. I could only pick two, so first of all, many of you gave very nice solutions, thank you. And since I had to pick two, let me describe very briefly the exercise and then show you the two who have some wonderful iPads that I'm told run great Google search and Microsoft Office as well. (audience laughing) The idea is I want to write a case-insensitive string class. It's a strawman example. There are other ways you could do it. But if I wanted this kind of type, how many comparison operators would I have to write today in C++17, the latest modern stuff we just shipped, in order to provide comparisons between CIString and CIString, CIString char* C-cell strings. And of course, that has to be symmetric. And even the CIString, CIString, I would like to be symmetric because you want conversions on both sides. The answer is, yeah, 12 ought to do it. No wait, 18 ought to do it. And how many of you have enjoyed writing code like this? Sorry, how many of you have written code like this? Way more hands. Only a couple of enjoyers.
On Hacker News
The talk about the reflection proposal was amazing. Meta classes are also very cool. We can only hope it comes fast. [VIDEO] — xaedes, 2018-01
Herb Sutter's talk about it is by far the best talk I've seen from from CppCon17. "Meta: Thoughts on generative C++" - [VIDEO] — slavik81, 2017-10
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. [VIDEO] — tylerhou, 2020-12
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 … — tylerhou, 2020-12
Related videos
- Wild Tricks for Greenscreen in Blender · IanHubert · 9:50
- Blender Motion Tracking - Room Transformation! · IanHubert · 7:57
- But what is the Riemann zeta function? Visualizing analytic continuation · 3Blue1Brown · 20:28
- CppCon 2015: Greg Law " Give me 15 minutes & I'll change your view of GDB" · CppCon · 14:46
- CppCon 2017: Louis Brandy “Curiously Recurring C++ Bugs at Facebook” · CppCon · 52:01
- CppCon 2014: Chandler Carruth "Efficiency with Algorithms, Performance with Data Structures" · CppCon · 1:13:41
- How wildlife trade is linked to coronavirus · Vox · 8:48
- How Python was Shaped by leaky Internals, Armin Ronacher, Flask framework · Видео с мероприятий {speach! · 49:55
- CppCon 2015: Andrei Alexandrescu “std::allocator...” · CppCon · 1:12:27
- Lexical Scanning in Go - Rob Pike · GoogleFOSSSydney · 51:17
- Why Isn't Functional Programming the Norm? – Richard Feldman · Metosin · 46:09
- Maybe Not - Rich Hickey · ClojureTV · 1:03:28
- Conway's Game Of Life in APL · Dyalog · 7:47
- Lecture 1A | MIT 6.001 Structure and Interpretation, 1986 · MIT OpenCourseWare · 1:12:55
- Crockford on JavaScript - Volume 1: The Early Years · YUI Library · 1:42:08
- Growing a Language, by Guy Steele · Bill Pugh · 53:31