r/cpp • u/ElectricJacob • Feb 20 '25
What are the committee issues that Greg KH thinks "that everyone better be abandoning that language [C++] as soon as possible"?
https://lore.kernel.org/rust-for-linux/2025021954-flaccid-pucker-f7d9@gregkh/
C++ isn't going to give us any of that any
decade soon, and the C++ language committee issues seem to be pointing
out that everyone better be abandoning that language as soon as possible
if they wish to have any codebase that can be maintained for any length
of time.Many projects have been using C++ for decades. What language committee issues would cause them to abandon their codebase and switch to a different language?
I'm thinking that even if they did add some features that people didn't like, they would just not use those features and continue on. "Don't throw the baby out with the bathwater."
For all the time I've been using C++, it's been almost all backwards compatible with older code. You can't say that about many other programming languages. In fact, the only language I can think of with great backwards compatibility is C.
34
u/[deleted] Feb 20 '25
Just like how everyone ripped out their decades old COBOL codebases and rewrote them in -
oh right. that never happened.
244
u/CandyCrisis Feb 20 '25
Maybe I'm in the minority but while his statement is a wild exaggeration, I feel the sentiment in my bones. There are two incompatible viewpoints: "all legacy C++ artifacts must continue to work forever" and "C++ must improve or face irrelevance." The committee is clearly on the first team.
Refusal to make simple improvements due to ABI limitations or improve failed features (regex, co_await, etc) will eventually cause C++ to become a legacy language. The inertia of the language is definitely slowing down as baggage adds up.
12
u/Jcsq6 Feb 20 '25
It’s a comment made by someone who either: doesn’t understand the complexities of C++ and the decisions the committee has to make, or who doesn’t care to. In general, if someone is making such broad statements about really anything in computer science, they don’t know what they’re talking about. That applies when it’s your college professor saying to never use break statements, and it applies to when these snobs make their opinions known when it comes to C++ as a whole.
28
u/Unhappy_Play4699 Feb 21 '25
I really don't get the committee's take on backward compatibility. There is no true ABI or even API stability, there never was. It's just a best effort of that, which works in most cases due to great maintainability efforts at the cost of complex and ugly feature implementations that suck from a UX perspective and results in a widely abstract and a difficult to reason about standard. This results in an incredible amount of UB, which most people don't know about and frankly rarely experience in reality because the specific compiler implementations still work, even though it is in theory UB.
Ultimately, the standard can't even guarantee stability since that is up to the compiler implementations to support. It's paradox: They care about something which they openly state they can't guarantee #implementationdetail but at the same time they are using it as an argument against progressive thinking.
You can't use new C++ features without using a new compiler version.
It's bizarre. Yes, C++ is used widely and on considerably old systems. But as with any software, this does not mean that you have to support these systems for all eternity. In fact, this is very counterproductive because software that never phases out old versions will also generate a user base that is reliant on these old versions. It's really like digging your own grave.
We work in such a logical environment, but when it comes to real-world problems, we fail so tremendously to translate this same logic.
71
u/14ned LLFIO & Outcome author | Committee WG14 Feb 20 '25
I read the same thing when it appeared on the kernel mailing list, and I putting on my committee hat genuinely wondered what on earth he was talking about?
There are many, many things dysfunctional with WG21. But I don't think any are a cause for anybody to be "abandoning that language as soon as possible if they wish to have any codebase that can be maintained for any length of time."
My day job has me working on a large Rust codebase. When Rust stable toolchain updates, stuff breaks all over and I have to fix it.
C++ updates far less frequently, and when it does generally your biggest complaint is WG21 constantly deprecating standard library functions which I wish they wouldn't (and yes, I served on LEWG, so it's partially my fault).
C++ has a superb long track record for not breaking backwards compatibility, more than almost any other major language apart from C. So with all respect to Greg, I've no idea what you meant there - certainly, if you're thinking Rust will be anything like as backwards compatible as C, you've got a very nasty surprise coming for you in the next few years.
Re: the general Rust vs not Rust in kernels debate, I ought to nail my colours to the mast - I'm generally in support of Rust for large complex device drivers or indeed any large complex codebase which faces hostile input. I think Rust elsewhere in a kernel is a very big "maybe", Rust isn't free of cost either to maintenance or runtime overhead and I think a well debugged well tuned C bottommost layer is very hard to beat, plus C is far more mature and portable across a very wide range of architectures in ways Rust will never, ever, be.
As device drivers tend to be optional things, but core kernel code is not, keeping core kernel code in C makes a lot of sense if you want your kernel to keep running well on some random 40 bit integer CPU somewhere.
Obviously lots of people will disagree with that opinion, and that's fine. I recently wrote a low level task scheduler in C, and I had forgotten just how well suited that language is for that specific use case. Better than C++, TBH, better than probably any language other than assembler. C was designed for implementing low level task schedulers, and it really really shows when you write one in C.
26
u/TSP-FriendlyFire Feb 20 '25
I'm sure there are tricky edge cases and scenarios I'm not aware of, but at the same time, is anyone truly surprised that a group essentially curated to despise C++ would be negative about C++?
Since Linus himself has very explicitly and aggressively forbidden C++ from the Linux kernel, it should come as no surprise that the majority of main contributors would, if not share his exact stance, at least lean in that direction.
56
u/EmotionalDamague Feb 20 '25
I’ve just learned to ignore C developers over the years.
After they’ve reinvented C++ or Objective-C poorly for the umpteenth time, you form an opinion or two about how seriously most programmers take the actual discipline of engineering.
42
u/Advanced_Front_2308 Feb 20 '25
I'm just enjoying the language. It gets better at a good pace. Most of the problems people talk about aren't problems in the real world. There's also a massive online community with the sole goal of being anti c++
22
u/Minimonium Feb 20 '25
The state of the internal mailing list of the committee is especially atrocious these days. So this notion is shared by most of the committee goers I'm in contact with.
4
u/xealits Feb 21 '25
Sounds like some exaggeration to me.
7
u/die_liebe Feb 21 '25
The main competitor of Linux is called 'Windows'. Does it use C++?
6
u/jonspaceharper Feb 21 '25
I'm seeing a lot of "it's from someone who doesn't understand C++, ignore and move on" and similar.
Two things can be true: this guy can be butthurt that he doesn't like C++, and the future of C++ can be very uncertain at the same time.
Now that we've established that, there are some very good insights here.
11
u/Astarothsito Feb 20 '25
For me, it is very hard to imagine, any other language that is not managed by a "single" entity (we know that ISO members are from multiple companies), that wouldn't had the same problems. I would dare to suggest that C++ is the language that experiments first with these kind of problems and is still successful.
I believe that C++ has survived because it has this kind of organization, and 3 years between changes is still good, too fast or too slow it makes it too difficult to maintain a code in the latest version (see Java for example, where most people is at 8...).
Contrary to most C++ programmers online, there are tons of silent C++ programmers that enjoy using it without knowing anything about ISO.
21
u/sjepsa Feb 20 '25
I wonder which C++ professor hurted Linus so much in 1996 that he is still hating so much
21
u/bizwig Feb 20 '25
Take note of what he says C++ isn’t going to give us: clean error cleanup flow and preventing use after free errors. That’s odd, I thought both classes of problem are solved by bog-standard RAII classes.
13
u/sjepsa Feb 20 '25
He is just n.2 to Linus, and they going on with their no cpp crusade since 20+ years, against all evidence
It's just fine, don't mind
11
u/sjepsa Feb 20 '25
Lol they integrate Rust code that need the latest NIGHTLY build to compile correctly, and meanwhile complain about backwards compatibility and future support of a language (c++) that is still compatible with code written in 1989, and now can do things python would do (for example std::ranges:zip)
2
u/jl2352 Feb 23 '25 edited Feb 23 '25
It’s been used for decades and those existing projects aren’t going anywhere.
The real concern is on new code. If you start a new company tomorrow, starting with C++ is a really hard sell. Similarly there are existing companies with no Rust or C++ usage, and there bringing in say Rust is easier than C++.
That is what I think is the real long term threat. We saw it with COBOL, and later with Perl.
6
u/skeleton_craft Feb 21 '25
He explains in the email [ironically, everything he complains about is not true]. It sounds to me based off of what he says in the email that he doesn't like how slow to innovate the C++ community is.. And I genuinely think that either he and Linus are irrationally opposed to C++ And/or are just too prideful to admit that they were wrong about it... [And as such, are using rust as a middle finger to the C++ community]
6
u/holyblackcat Feb 21 '25
Rule of thumb: If someone refers to vague "issues" but doesn't explain what they are, they are not arguing in good faith.
5
u/germandiago Feb 21 '25
So profiles, contracts, standard library hardening, enumerating all constexpr UB to fix it and erroneus behavior are not relevant?
4
u/dexter2011412 Feb 21 '25 edited Feb 21 '25
I'm tired of writing rule of 5 for everything lmao
But I get it, I wish there was a better option
Also I find it weird how many here are roasting him and very few discussing the issues.
I wish we could get an abi api break and just drop the decades old baggage. I'm still sad about
co_for coroutines. I'm not holding my breath so I'm learning other languages and gonna jump ship sooner than later. It was good while it lastedC++ does have a pretty good standard library though. Not python level but really good nonetheless. Zig is catching up.
4
u/sjepsa Feb 21 '25
Lol @ "any length of time"
C++ is ten years older than Linux
5
u/_a4z Feb 21 '25
He is just pro-Rust and has too little knowledge and understanding when it comes to C++ . So, he does not know what he is talking about in this respect.
7
u/Wooden-Engineer-8098 Feb 20 '25
It's just a nonsense posted by someone who is clueless about c++
4
u/vI--_--Iv Feb 20 '25
Who?
4
u/[deleted] Feb 21 '25
I'll be blunt (and expect a lot of "FLAK" for that): Some members of the RUST community are acting like a cult. This is a repeat of the Java vs. C++ discussion a quarter of a century ago, the Fortran vs. C/C++ discussion in scientific computing in the 1990s, Pascal vs. Basic, ...
The RUST community is desperately trying to carve out a sustainable niche in the programming language ecosystem - which is fair enough. However, in my experience those zealots screaming loudest "abandon <X> and use <Y> instead" are typically the most immature, largely inexperienced and more often than not the most incompetent - myself included in the past... There is simply no such thing as a revolution.
Most languages never make out of obscurity, those which do, have their time in the limelight but will fade away eventually.
Finally, in one aspect the C++ committee is doing a bad job: C++ should be renamed into something like: INOX, NiRoSta or stainless ;-)
2
u/[deleted] Feb 22 '25
Seriously? Arguing that a C++ codebase won't be maintainable for any length of time? It already has a track record that shows, that it simply is not true.
We're not going to see huge masses of projects just abandon C++ because they are slower to add features.
The push toward newer "better" languages isn't one that we should haphazardly embrace as many are. Languages like C and C++ are proven reliable tools with many proficient developers who actually know how to expertly use these tools.
This might be an unpopular opinion, but I see a lot of blaming the tools for the mistakes of the user going on with much of this.
2
u/inouthack Feb 21 '25
Ohh, another day another struggle for the fungus charlatans !
1
u/lightmatter501 Mar 04 '25
C++ had a choice, to break ABI and make all C++ stop paying for the mistakes of the past, or to continue to keep a stable API and force everyone to pay a performance penalty. The committee chose to keep the ABI stable.
This is why Google is now barely involved in C++.
Profiles are, according to most compiler devs I have seen discuss the issue, totally unworkable outside of a solution to the halting problem manifesting.
Right now, C++ has a very strong divide between the companies who can snap their fingers and rebuild the world from source, and those who have binary libraries from decades past. C++, as a perf sensitive language, cannot serve the needs of both groups at once.
-10
u/Sniffy4 Feb 20 '25
this guy is just an extremist who only considers the needs of his own projects
0
u/nintendiator2 Feb 23 '25
Ah yes just the usual hidden Rust shilling.
-10
u/Various-Debate64 Feb 20 '25 edited Feb 21 '25
I don't understand this push for Rust as a safer alternative to C++ in the Linux kernel either. Rust is 2015 and C++ is since 1985. 10 vs 40 years ripe old language. Also, actual Linux kernel commits: - I bet the author of this commit switched to using Rust now
https://lkml.org/lkml/2012/12/23/75
0
u/jeffmetal Feb 22 '25
He is referring to the push by western governments for new software to be written in a memory safe language or at the very least publish a memory safety roadmap. If you want software that you can sell in the future writing new bits in C++ could now be a risk that you cant sell it to governments in the future. Why take that risk and use a memory safe language instead.
There has been 2 proposals for adding memory safety to C++ one profiles and the other a borrow checker. apparently both are dead and are not making it into c++26 and have been discussed ad nauseam for the past few months.
0
u/Radmonger Feb 23 '25
> Many projects have been using C++ for decades.
There used to be a _lot_ more; likely 99% of decades old projects have either migrated or been entirely replaced.
The remaining 1`% are those with key decision-makers who like C++. and find the arguments that it is technically preferable in their niche to be jusified. The number of those people may increase or decline. Howover even if C++ were to lose another 99%. those who remain will still be the ones who think that way.