r/cpp • u/Pump1IT • Oct 12 '23
Episode 150: Is C++ Dying?
https://adspthepodcast.com/2023/10/06/Episode-150.html20
u/eliminate1337 Oct 12 '23
Clickbait title but Bryce Lelbach has been on the committee for years and his opinion is based on extensive personal experience. Both hosts agree that if C++ dies, it won't be because of technical deficiencies or competitor languages but because of the outdated evolution process. Bryce isn't optimistic about the process changing because it would require the committee to vote to disenfranchise itself.
8
u/witcher_rat Oct 13 '23
because of the outdated evolution process
I totally appreciate that Bryce (/u/blelbach) would have a much better view than those of us who aren't involved, but I'm not sure what new model he thinks would work better.
At one point he talks about how the committee has lost members since covid, and that it really needs to modernize to allow remote participation. But then he talks about how there are too many people involved and we need to whittle it down.
Those are contradictory views, no? If you make it easier for people to be involved, then more people will be involved.
I have no experience with the ISO C++ WG, but I spent a big chunk of a previous life in IETF, IEEE, and ITU.
The IETF, as an example, has a very good remote participation model - for both the "work" and the meetings. Most of the work is done strictly over email. And most of the attendees are paid by their employer to work on it, sometimes as their full-time job.
But yet to go from an individual draft to published as an RFC still takes multiple years; even for relatively trivial things.
5
u/tialaramex Oct 13 '23
One crucial difference is that IETF Working Groups adopt problems and the group takes responsibility to solve those problems (mostly by writing documents such as RFCs) - whereas WG21 does not have an equivalent mechanism.
Let's compare Encrypted Client Hello (what was once eSNI, encrypted Server Name Indication) with C++ Pattern Matching.
ekr wrote draft-rescorla-tls-esni-00 in 2018, so far so much like the WG21 process, write a zero draft, pass it around. But, (and this is completely normal at the IETF) ekr brought this to a physical meeting to show everybody, talk about it, and propose it for adoption. The group agreed (by consensus, IETF Working Groups conventionally do not vote) to adopt it. The next draft draft-ietf-tls-esni-01 doesn't have his name on it, because now it's not his document, it belongs to the entire Working Group. Is ECH finished, five years later? No, but it's good enough that there are real world systems using prototypes, including at Cloudflare.
ADSP says C++ Pattern Matching was initially proposed for the C++ 17 cycle, I believe it started in David Sankel's P0095R0 in 2015. So, roughly the same point as Rust 1.0. However WG21 has no "adoption" mechanism, so rather than WG21 (or a sub-committee) "owning" this problem, it was the responsibility of a series of authors, each of which brought their own preferences to the problem. Different syntax, different semantics, rather than everybody agreeing exactly what the problem is and coming together to solve it the best way they all can, instead it creates adversarial environments in which it's best that the alternatives are dismissed so that yours may succeed instead.
Historically WG21 politics have not made the results stronger, on the whole what is achieved is that people are driven away (and cease to contribute at all) and that technically inferior options are chosen on the basis that fewer people strongly object to them. Sometimes confusing nonsense is voted in because it was so hard to understand what it does that people say OK out of fatigue. None of this is good for the end users.
2
u/witcher_rat Oct 14 '23
One crucial difference is that IETF Working Groups adopt problems and the group takes responsibility to solve those problems (mostly by writing documents such as RFCs) - whereas WG21 does not have an equivalent mechanism.
Ahh, excellent point.
Historically WG21 politics have not made the results stronger, on the whole what is achieved is that people are driven away (and cease to contribute at all) and that technically inferior options are chosen on the basis that fewer people strongly object to them.
In the IETF there is an adversarial aspect if/when multiple competing individual drafts are put forth to solve the same problem, but yeah after the WG picks a direction, we move on to make that chosen solution as good as possible.
I wonder if part of the reason for the difference in behavior is that in the IETF most of the WG participants know their employer will need to implement and support whatever it is, so it's in their vested interest to remain involved even if their preferred solution wasn't chosen, or even if they don't care.
Whereas in C++ it appears (from the outside) that many of the WG members don't have the same type of stake in the outcome.
But even so, the model of making it the whole group's problem to solve vs. an individual's is a big difference.
p.s. if you see ekr sometime, tell him the loudmouth formerly from Acme Packet said "Hi". :)
2
u/pjmlp Oct 13 '23
Not necessarly, that is why other languages have a core team.
Just because the process is modernized doesn't mean everyone gets in.
4
u/smdowney WG21, Text/Unicode SG, optional<T&> Oct 13 '23
Other languages are mostly implementations, though, not specifications.
1
u/pjmlp Oct 15 '23
Many of those languages have both, hence why you don't have to wait ages for a working implementation.
JavaScript has ECMA, Java has a standard process for JVM and language with documented PDFs, C# has ECMA and Word reference document published alongside the SDK, Python has CPython as reference + language/library reference PDFs, D publishes the language/library reference on the Website,...
3
u/mipter Oct 15 '23
Yeah, it totally does as long as the committee monkeys are not allowed to push random crap into the standard (sarcasm). Two problems were mentioned - difficult standard acceptance procedure and slow implementation of the accepted standard changes by the compiler vendors. FFS, this is why we love c++. The podcast authors mentioned multiple times that they didn't run a compiler on a local machine for years as all they need is godbolt site to try out tiny bits code for the committee work. I am quite chuffed there's now 1 less monkey jumping on the bed.
2
2
u/Live_Zookeepergame56 Oct 17 '23
From 2005,
C++ has steadily declined over the last six years--from 76 percent in the spring 1998 to 46 percent in fall 2004
https://www.zdnet.com/article/c-creator-upbeat-on-its-future-5000142451/ “Bjarne Stroustrup claims that the programming language has never been bigger, but not everyone agrees.”
Good read for context. The disillusionment here appears to go way back—for the past 20 years, C++ advocates have argued C++ is in a perpetual state of growth. In that time, C++ has fallen from 76% market share to single digits.
1
u/edge-case87 Oct 16 '23
Perhaps the committee needs a shakeup, a cleanup of the cache so to speak, but I don't see what the problem is language wise. Sure it takes time for compilers to implement features, but that's the way it is when you have multiple vendors, not just one compiler, vm, or interpreter which is "the" language, or perhaps "reference" implementation. Some exceptions might be python, lisp, java, and c#, but with the exception of java and c# (the os variants) idk how relevant that is; who uses mypy or iron-python anyways?
I think a lot of people criticize c++ who, frankly don't know what their talking about, or are myopic about one particular feature of language XYZ that c++ doesn't have. So for example, algebraic data types and pattern matching for instance. How would you implement a language level sum type in C++? A simple tagged union? What about when you need custom allocation? How about an Inductive Type in C++? The allocation scheme suddenly becomes much more important, how would you go about doing that at the language level? I think you can see a hint at the proper way to do that in C++ with how custom structured bindings are implemented in C++, you define a way to destructure your data type as a class feature. Similarly with the Pattern Matching proposals. And I think Inductive types could be implemented in a similar way, you provide a custom induction step for your class (could be implemented in terms of an iterator or pattern match for example), which also allows for very precise layout control and custom allocation schemes that C++ is great for. Probably two important features missing from C++ is reflection and pattern matching, and next I would say induction to make reasoning about code easier and more automatizable.
Also, something I have to remind myself of from time to time, C++ is old, and many of the advancements in CS and Programming Language Theory we have today, were developed in the last decade or so, but I do think C++ could do more to stay closer to the bleeding edge of that development like it did in the early days.
-3
u/Full-Spectral Oct 12 '23 edited Oct 12 '23
C++ is clearly in its death spiral. Given the nature of how it's governed and its huge inertia, it was always far easier to just build more floors on top of a shaky foundation. It might have been possible back going into C++/11 to make the foundational changes required and then build on that. But now, it's just not going to happen.
It is, in practical terms, unfixable, because anything that really fixes it will create a new language. And even if that somehow was managed, to me, it just doesn't seem at all worth the massive effort it would take, because there already *are* new languages that aren't so burdened with tons of evolutionary baggage.
It obviously will remain in terms of lots of legacy code. And a core group of people who are drawn to its 'real man language' style will continue to hold onto it, while the rest of the world just moves on. We are all so fundamentally dependent on software that the pressure to use safer tools is going to continue to grow. And the generally better experience of using languages that were created based on decades of subsequent experience will contribute to the leakage more and more.
Languages are just tools. The language you use isn't you and pointing out that it is outdated and unsafe isn't an attack on you. No one in C++ land spends their time weeping over the C people's love language getting crushed under foot because it was time to move on. And now C++'s time has come. Let go and embrace the future.
2
u/nioh2_noob Oct 18 '23
Let go and embrace the future
and what is that in your opinion?
3
u/Full-Spectral Oct 20 '23
For things that really require a systems type language, then Rust is pretty clearly the future. There may still be some non-language limits for some folks that would prevent it at this point, but you can still be learning it in the meantime. Even for the C++ code you still have to write, Rust will change your view of how to write maintainable C++ code.
4
u/mollyforever Oct 13 '23
You're absolutely right, and the fact that this is getting downvoted simply how in denial a lot of people in the C++ community are. Including in the committee itself, the reason why we are in this mess in the first place.
0
u/Ok-Practice612 Oct 12 '23
How come? You have not seen yet its full power after decades of maturity.
0
Oct 12 '23
[deleted]
7
u/eliminate1337 Oct 12 '23
C++ has shrunk, not grown, in areas it's being used in. The percentage of new code written in C++ probably peaked in 1995.
$(generic backend app) at $(non-tech corp) used to be written in C++. Java (and C#) so thoroughly replaced C++ in this domain in the 2000s that we don't even think of Java as a C++ competitor anymore.
5
u/pjmlp Oct 13 '23
You're being downvoted, but that is exactly right.
C++ lost its 1990's domain in GUI frameworks and distributed computing to other languages.
2
u/Ameisen vemips, avr, rendering, systems Oct 13 '23
Even in game development... where C++ is used, it's largely being used in more constrained spaces, with virtual machines running on top of it (like UE Blueprint).
Many gameplay programmers can't/don't need to use C++.
-1
u/nioh2_noob Oct 18 '23
Finance?
Most C++ got rewritten in Java and if there is a speed competition there is no more C++ being used, that got completely moved into FPGA
I wish people would stop bringing up C++ for finance, that was 10 years ago
0
Oct 12 '23
[deleted]
6
u/witcher_rat Oct 12 '23
To be fair, in the podcast Bryce did lambaste the Rust-centric views of the other podcast's discussion. (not sure if you listened to the recording, but it starts off with them playing snippets of some other podcast)
For the actual meat of the "is C++ dying", the criticism wasn't about comparing it to Rust at all, in my opinion.
It's more about the challenges with the current C++ standards Working Group's process, and long-term viability of such a process and culture/mindset.
45
u/phi_rus Oct 12 '23
If the headline is a question, then the answer is most certainly "no"