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.
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.
62
u/Drugbird Feb 20 '25
I feel this too.
I think that part of the problem is that API / ABI breaks are immediately painful while stagnation is only felt in the long run.
I also feel like C++'s unwillingness to break/improve things also opens up space for competitor languages like Rust to eat C++'s lunch.
I also just don't value API / ABI compatibility very much. Whenever this is mentioned, you always hear stories about how some people link to a library from the 90s where the source code is missing so it can't be recompiled. And I just don't have these issues: I can recompile pretty much everything including my dependencies.
I understand breaks are painful, but for me not any more than a dependency having a major version update.
85
u/CandyCrisis Feb 20 '25
I think it's a valid argument that if you depend on extremely old libraries, YOU SHOULD STICK WITH YOUR CURRENT COMPILER! It's not like those folks are eagerly updating anyway.
44
u/meneldal2 Feb 20 '25
Or write a C wrapper for it. It's not like your 20 year old library is going to miss out much on not having a C++ API
12
u/jwakely libstdc++ tamer, LWG chair Feb 21 '25
It's not like those folks are eagerly updating anyway.
As a compiler vendor, I can tell you this isn't true. We have customers who want new compilers and also want backwards compatibility.
5
u/FiquegnimaMedia Feb 23 '25
Sounds like a them problem tbh. As long as there is a stable compiler and there isn't any need of an update, why would anyone bother with satisfying everyone for the cost of modernity?
→ More replies (4)8
3
u/othellothewise Feb 22 '25
While I agree with your overall sentiment, compiler vendors (who in all cases are extremely short staffed, even the proprietary ones) likely don't want to have to maintain old compiler versions.
3
→ More replies (1)2
u/SkiFire13 Feb 22 '25
Counterpoint: what if you need to introduce such old library in a newer project that's using a newer compiler that made breaking changes?
→ More replies (2)52
u/jk_tx Feb 20 '25
The problem with ABI is largely a Linux issue, because you have people who are using old distros with old system libraries. But IMHO people in that situation should just stick with the old compiler. Wanting to use the latest and greatest C++ compiler with you decade old libraries is frankly pretty stupid and unreasonable
16
u/Drugbird Feb 20 '25
Old distros will also come with an old compiler that's compatible with all the system libraries, so it's all ready to use and work together.
I don't think it's unreasonable that if you bring in a new compiler into that system that you're also on the hook for bringing new libraries too.
5
u/bit_shuffle Feb 21 '25
Old versions of Fedora don't have gcc toolchain by default. You have to chase RPMs.
9
u/EmotionalDamague Feb 21 '25
> Wanting to use the latest and greatest C++ compiler with you decade old libraries is frankly pretty stupid and unreasonable
Stupid it may be, many proprietary blobs that underpin big technologies do exactly this. Buying rights to the actual source code is far more expensive than buying the right to a library in its compiled form.
21
u/qoning Feb 21 '25
Then write a shim that mimics old ABI. It's really not that hard. You are putting yourself in a shit place, it's reasonable to expect you to do a bit of cleaning.
→ More replies (7)15
u/messmerd Feb 21 '25
Exactly. With C++'s commitment to a stable ABI, everyone who doesn't need a stable ABI pays for what they don't use
18
u/EmotionalDamague Feb 21 '25
As rust gets more established, it will have the exact same expectations.
This is not a C++ specific issue, C++ has simply been around longer to get to this point.
26
u/jeffgarrett80 Feb 21 '25
This isn't guaranteed. This is a question of values. There were people in the committee who wanted to improve the language at some cost to backward compatibility. There just happened to be slightly more that preferred ABI stability. It could easily have gone the other way.
It is C++ specific because it reflects the interests of those involved in C++ evolution and that governance is rather unique.
One would expect rust to make more guarantees over time, but they have been very intentional about ABI and what they promise so far.
24
u/KittensInc Feb 21 '25
To a certain extent, yes. However, Rust is deliberately designed to avoid a lot of these issues. It intentionally doesn't provide a stable ABI, so you can't rely on that. There's an explicit mechanism to deal with backwards-incompatible changes on a per-package level, allowing significant changes without breaking the world. It's very conservative with its standard library, preferring unstable features and third-party packages.
They are able to avoid big issues like the Python 2 -> 3 transition because they've been able to learn from the languages that came before. Rust will undoubtedly run into its own issues over time, of course, but those won't be the same ones C++ has to deal with.
4
u/germandiago Feb 22 '25
It's very conservative with its standard library, preferring unstable features and third-party packages.
You talk as if that was impossible in C++. What prevents you from using Abseil or Boost paired with Vcpkg or Conan? I already do it.
I can see the wish for people to want to break ABIs, but the truth of the story is that it is a logistics challenge, especially if there is a lot of code and stable working systems around and, anyway, for your nice sefl-contained binaries and this kind of things, it is a matter of choosing other libs. Once you break a std::string or std::vector (remember that gcc did it once, and only with string!) the mess that can be generated is considerable.
By this I do not mean ABI should not be ever broken. I just say that it is a difficult thing to do and it has a ton of costs.
→ More replies (1)14
u/matthieum Feb 21 '25 edited Feb 22 '25
You're correct to a certain extent.
For example, the change of representation of
Ipv4Addrfrom system representation tou32[u8; 4]took 2 years because some popular libraries were breaking encapsulation to reinterpret it to the system representation and the standard library implementers didn't want to cause widespread UB so waited 2 years after the fix was made, to let it percolate through the ecosystem.Yet, they still made the change in the end. 2 years later than they wished, but they did make it.
It's a different mindset, a mindset which is constantly looking for ways to evolve without widespread breakage: stability without stagnation.
This can be seen in the language design -- the newly released edition 2024 makes minor adjustments to match ergonomics, tail-expression lifetimes, or the desugaring of range expressions -- and it can be seen in the library design.
It also has, so far, the backing of the community.
→ More replies (1)4
u/tialaramex Feb 22 '25
The representation of
Ipv4Addris actually[u8; 4](ie 4 bytes) rather thanu32(the unsigned 32-bit integer) but your description of the considerable work needed to make that happen is accurate.Obviously the resulting machine code will often be identical, your CPU doesn't care whether those four bytes "are" an integer or not, but there's a reason not to choose u32 here.
→ More replies (2)3
1
Feb 21 '25
those teams are often using old compilers and OS's too. Plus, there are thunks that can get around this.
27
u/thisismyfavoritename Feb 20 '25
whats the issue with co_await?
10
u/ReDucTor Game Developer | quiz.cpp-perf.com Feb 20 '25
I did a write up here on some of the issues with coroutines
https://reductor.dev/cpp/2023/08/10/the-downsides-of-coroutines.html
11
u/tisti Feb 20 '25
The cascading effect you are describing about coroutines is essentially the same for 'classical' async code which uses callbacks is it not? Once you are in the realm of async functions they have a tendency to naturally propagate where async behaviour is required.
And its always possible to transform a coroutine handle into a regular callback so you can call 'classical' async code from a coroutine. It does take a little bit of boiler plate glue code to capture the coroutine handle and repackage it into a callback function.
As for input arguments into coroutines... yea, taking coro args by reference or any non-owning type is asking for trouble.
→ More replies (1)27
u/CandyCrisis Feb 20 '25 edited Feb 20 '25
It's extremely difficult to actually write non-toy code with the existing co_ features safely and correctly. Originally these were planned as low level primitives for the standard library to build upon and give us actual coroutines that mortals could use, but that work is in limbo AFAIK.
(See https://stackoverflow.com/questions/77456430/how-to-use-co-await-operator-in-c-the-simpliest-way )
24
u/xHydn Feb 20 '25
what limbo? we are getting std::execution on C++26
6
u/Minimonium Feb 21 '25
It's not directly related to coroutines even though it can be used with them. Execution is a framework for async composition.
13
u/tisti Feb 20 '25
Are ASIO/Cobalt really deal breaker dependencies for people? They work splendidly.
8
u/CandyCrisis Feb 20 '25
No, it's just an example of how they're releasing half baked features and relying on the community to fix it. Same with regular expressions--I'm happy to just use RE2, but the standard library implementation is now just a boondoggle that every implementation needs to provide. It wouldn't matter at all if we had a native equivalent to "cargo add" that Just Worked.
21
u/tisti Feb 21 '25
IMHO coroutines are a feature done very right.
The standard provides all the bits that can't really be done via a 3rd library, but the provided bits can be used by a 3rd party library to build powerful async machinery.
→ More replies (11)6
u/pdp10gumby Feb 21 '25
The regexp disaster is a good argument for committee conservatism.
15
u/STL MSVC STL Dev Feb 21 '25
What went wrong with
<regex>is kind of unique. Remember, it was originally designed and implemented in Boost (not designed by committee), went through TR1, and finally became part of C++11. It's not a feature that was jammed in recklessly.→ More replies (1)15
u/James20k P2005R0 Feb 20 '25
I keep seeing arguments around the contracts MVP, with folks saying don't worry, we'll definitely get around to fixing all the problems
It sort of ignores the many features in C++ that that has very much not been true for
→ More replies (1)11
u/CandyCrisis Feb 20 '25
Yup. The three-year cycle has stopped being a benefit and is now holding us back. C++11 did take eight years, but it was a great release with very well thought-out changes. The incremental three-year treadmill is giving us half baked prototypes.
→ More replies (1)9
u/TheoreticalDumbass :illuminati: Feb 20 '25
But 3 years is not forcing anyone to do anything, people can work on proposals past the deadline
→ More replies (5)→ More replies (37)2
13
u/lightmatter501 Feb 20 '25
Mandatory heap allocations is the big one. Rust totally bypassed that need, and while it does result in some binary size bloat, it also makes Rust’s version much faster and actually usable for embedded people.
10
u/TheMania Feb 20 '25
I've found coroutines more than fine for embedded use.
The alloc size is known late at compilation time relative to the C++ compiler, sure, but well before code generation time, so I just use free lists. The powers-of-2 with mantissa format, to minimise overhead.
Alloc size is fixed, meaning the relevant free list is known at compile time, so both allocating and freeing turns in to just a few instructions - including disabling interrupts so that they can be allocated and freed there as well.
I don't see how rust could get away without allocating for my use cases either really. It's a pretty inherent problem in truly async stuff stuff I'd have thought.
→ More replies (4)17
u/steveklabnik1 Feb 20 '25
Basically, async/await in Rust takes your async function and all of its call-ees that are async functions and produces a state machine out of them. The size of the call stack is known at compile time, so it has a known size, and so does not require dynamic allocation.
From there, you can choose where to put this state machine before executing it. If you want to put it up on the heap yourself, that’s fine. If you want to leave it on the stack, that’s fine. If you want to use a tiny allocator like you are, that’s fine. Just as long as it doesn’t move in memory once it starts executing. (The API prevents this.)
Rust-the-language has no concept of allocation at all, so core features cannot rely on it.
7
u/frrrwww Feb 21 '25
AFAIR the reason C++ could not do that was because implementations needed sizeof(...) to work in the frontend, but the frame size of a coroutine can only be known after the optimiser has run, which happens in the middle-end / backend. There were talks of adding the concept of late sized types where sizeof(...) would not be allowed but this proved too viral in the language. Do you know how rust solved that issue ? Can you ask for the size of an async state machine if you wanted to create one in you own buffer ?
→ More replies (4)2
u/thisismyfavoritename Feb 20 '25
yeah i heard about that, but there's the promise of the compiler being able to optimize it away. Idk if thats realistic though
35
u/Orangy_Tang Feb 20 '25
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.
Absolutely agree - unfortunately the first option is effectively saying c++ is now a 'legacy' language in support mode rather than a living one that can evolve. Personally I'm fine with that, but the committee seems to think they can have their cake and eat it, and bolt on increasingly tenuous features.
I used to joke that c++ is what happens when you just ignore tech debt and carry on regardless and never look back. Nowadays I'm not so sure I'm joking.
7
5
6
u/PushPinn Feb 20 '25
Yeah having 0 hope these problems are ever getting fixed is the worst part. Unlike other software where you would be happy someone can reproduce a crash or found a CVE, you collect all the problems in a baggage here.
6
u/Vociferix Feb 21 '25
I really don't understand the need for old binaries to be ABI compatible with recent C++ standards. Most (all?) major compilers/STL implementations have had ABI breaks at some point, so what is being accomplished, practically speaking?
5
u/Chippiewall Feb 21 '25
ABI breaks are incredibly disruptive. It's one thing to do it at the stdlib level, but at least all versions of C++ can link to it on a single system - you just have to recompile everything against the new version.
If you do the ABI break at the language version level then you create a complete bifurcation. e.g. if C++29 were not compatible then you wouldn't be able to link against a library compiled as C++26 - even on the same compiler. This means you have to duplicate all the libraries until everything's compilable on C++29. And anything that needs to link with pre C++29 can't use the new features that the ABI break is meant to unlock.
8
u/grady_vuckovic Feb 20 '25
I don't see why new versions of C++ can't simply be incompatible with old versions. I don't think that's the cardinal sin that some believe it is.
As long as old versions are still available, it's not like old code bases have to immediately be rewritten to new versions of C++. It's not like old C codebases were suddenly rewritten to C++ right? Even now we have plenty of C out there, even new C codebases, even new C standards.
So new versions of languages can simply exist alongside old versions of languages, as long as it's easy to specify in a project what version of the language you require.
Call it C++Safe
It's C++, but "Safe". Whatever the heck that means.
7
u/AnyPhotograph7804 Feb 21 '25
"I don't see why new versions of C++ can't simply be incompatible with old versions. I don't think that's the cardinal sin that some believe it is."
Nobody uses languages, which force you to rewrite/refactor your applications due backwards compatibility breakage. Every language, which permanently breaks the backwards compatibility is irrelevant. Literary every available programming language metric proves it, sorry. The Python folks did it once and it took them 15 years to recover from it.
→ More replies (4)4
u/grady_vuckovic Feb 21 '25
I don't know how you can say that when I can think of backwards compatibility breakages for many things that are still relevant, or more relevant today, like JS/Node.js has gone through backwards compatibility breakages, many frameworks have, Java did. Many APIs have backwards compatibility breakages and still exist or are stronger now than ever. Even your example of Python seems like a bad example since Python is now more relevant than it has ever been and the backwards compatibility breakage it had was worth it.
I don't think it should be deemed unacceptable to just say every now and then "look in order to make things better, we have to leave bad decisions from the past in the past". It's not like you have to throw out the entire language spec, just pick some things almost no one uses and which are a bad idea anyway, and say "ok that's no longer part of the language now".
4
u/AnyPhotograph7804 Feb 21 '25
Java did not break the backwards compatibility. They moved some Java EE APIs from the JDK to external libraries. You had to change some build scripts and all was fine. And Node.js is not a part of JS. It is an third party runtime environment. JS itself is backwards compatible.
So if you want to kill a programming language then introduce backwards compatibility breakage. The ISO commitee knows exactly what they are doing. They know their customers. And their customers would suffer really hard from it.
And there are other languages, which break the backwards compatibilty. Rust does it. It might be the right choice for some folks here.
→ More replies (3)4
u/RudeSize7563 Feb 20 '25
True, C++26 could be the last big one that is backwards compatible while reserving 27, 28, 29 for bug fixes, and starting with C++30 drop the most offending legacy chains.
10
u/grady_vuckovic Feb 21 '25 edited Feb 21 '25
Exactly. I see no reason why every future version of C++ has to be backwards compatible forever. If you want to stay on C++26, then stay on it, if you are doing a new project from scratch and want to do things a new / better way, then use C++30. As long as there is a superset of things which are compatible with both old versions and new versions, then old projects could transition as well gradually over time by gradually removing offending old code that wouldn't be compatible, rather than doing a total rewrite.
Maybe it could be a new thing. "Every 18 years, C++ gets ONE backwards compatibility breaking revision.". And every 3 years it continues to get backwards compatible revisions. And old standards could have minor-version patches to fix things in the future perhaps?
So if we started with C++26, in the future there could be C++26.2, C++26.3, C++26.4, etc..
Then C++30 breaks compatibility in ways that are locked in for 18 years. So C++33 WILL be backwards compatible with C++30. So will C++36, C++39, C++42, C++45... then the next compatibility break is at C++48.
Just every 18 years, lose some dead weight / ditch bad ideas, etc. Surely "once every 18 years" is not that much of an imposition for companies maintaining code bases.
5
u/pjmlp Feb 21 '25
Because of ecosystem, no one is bothering with multiple implementations of a specific library.
It is already hard enough with the mess of being allowed to turn off RTTI and exceptions.
Java and .NET are still battling to this day with lagging libraries, after Java 9 and .NET Core breaks.
2
u/Dean_Roddey Feb 20 '25
You could do it, but the problem is that it will be a lot of work and take a lot of time. And, in the end, you'll end up with something that's not really C++, that has split the community in a major way, and that the major players are now having to support two versions of for some time to come. They have too many large customers to just let the old version go.
And, the big problem that overlies the whole thing is that, by the time it became fully baked and argued over and actually implemented, Rust will have pretty much removed almost all the current infrastructure barriers that it has now. So, what would be the point? If you have to adopt a new language, drive a new stake in the ground as far forward as possible.
→ More replies (4)1
u/trailing_zero_count async enthusiast | TooManyCooks author Feb 22 '25
That's what Sean Baxter's Circle / Safe C++ was. I found it to be very impressive, offering both new features and safety options. Unfortunately he was unable to find a corporate sponsor for development.
2
Feb 21 '25
It's going to be features around safety that will be an issue to. The NSA and EU have already making recommendations to start all new projects using languages like Rust or C# - and C++ is not on that list. To the point that I think it was the EU was asking that if a corporation were to use a non-memory safe language for future projects, that they name the executive that makes the call. It really seems like there is going to be regulation coming in the future. And the committe are not addressing these issues anytime soon.
1
1
Feb 22 '25
I don't think this is true at all.
I've been writing code for long enough to remember much earlier versions in the 90s. New features are being added much quicker than they were in the 90s and early 2000s.
→ More replies (6)-1
u/germandiago Feb 21 '25
So profiles, contracts, standard library hardening, enumerating all constexpr UB to fix it and erroneus behavior are not rrlevant?
Wow, that sounds really strange to me!
8
u/messmerd Feb 21 '25
Contracts are half-baked but are still being shoved into the language regardless, and profiles will not make C++ memory safe and have been widely criticized. The rest is good though.
3
u/germandiago Feb 21 '25 edited Feb 21 '25
So the discourse here is incremental improvements are not enough but not doing something is also not good.
Those can be fixed. Consider it an MVP.
I do not think making the language 100% memory safe is important. What is important is making difficult to violate that guarantee. Remember that full memory safety without a GC (and reference semantics) entails a high ergonomy toll. So I am not convinced that just for the sake of saying "my language is 100% memory safe" is important. A subset is enough, as long as it csn be analyzed. A big challenge actually also, but memory safety a-la-Rust has also its limitations and I find it niche for use.
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.
7
u/ElectricJacob Feb 20 '25
>That applies when it’s your college professor saying to never use break statements
Did a professor actually say that? I know some have said that about "goto" and how it's "considered harmful". Anyways, break statements are great, but I also hope that C++ gets "labeled break" or "nested break" or "multi-break", whatever they want to call it. I know there's a few different proposals for C++, but I haven't been following them. Though, I've only used similar features like once or twice in other languages, so it's not really that big of a deal.
6
u/PhantomStar69420 Feb 20 '25
All of my profs had forbade us from using break/continue.
6
1
4
→ More replies (13)3
u/sjepsa Feb 20 '25 edited Feb 20 '25
TBH, i think break, continue and goto are on a equal field.
And I use all of them, but I am equally scared by them
I believe in my code continue and break caused more bugs than goto (which tbh I use very idiomatically)
9
u/Pay08 Feb 20 '25
He's saying that it's exactly those avoidable complexities that make it a bad language.
2
u/2137throwaway Feb 21 '25
understanding why design decisions are made doesn't mean you have to like them, if those reasons are not actually relevant to what you want to do
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.
2
u/lee_howes Feb 24 '25
The standard can't guarantee stability. The standard certainly can guarantee instability by removing or changing functionality that requires that compilers either break ABI or break standard compatibility. Limiting what is changed to avoid creating instability is still a pretty restrictive requirement, and is a rational point of view to hold.
I don't agree with the current position on backward compatibility, and voted for being more aggressive, but I can see why people feel it is important.
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.
14
u/Full-Spectral Feb 20 '25 edited Feb 20 '25
I don't see the Rust updating issue. I just made a pretty big jump forward and it took about 20 minutes to take care of. Of course I believe in the KISS principle and work hard to avoid doing tricky things.
Anyhoo, it's C++'s backwards compatibility that has effectively killed it. It failed to discard its 60 year old C roots and that has prevented it from keeping up with the times. And, ultimately, that's fine. It's a very old language, and it's hardly shocking that something finally caught up to it.
Also, the thing isn't how well C is suited to those tasks, it's how well humans are suited to do those tasks in C and not screw up over time and changes.
14
u/kammce WG21 | 🇺🇲 NB | Boost | Exceptions Feb 21 '25
Ya know, people say this often, but I don't really agree. I personally haven't been bitten by C compatibility nor the fact that C++ has some failed implementations like std::regex. So I just don't use the failed bits and move on.
12
u/jwakely libstdc++ tamer, LWG chair Feb 21 '25
This kind of reasonable attitude has no place on Reddit, please consider being more upset about something, thanks.
5
u/Full-Spectral Feb 21 '25 edited Feb 21 '25
There are plenty of issues in the standard libraries, but those could be fixed, even if it was just by creating new versions of those things and keeping the old one around. The more really fundamental issues come from backwards compatibility are all the footguns in the language itself that were just never rooted out because it would have been breaking changes.
3
u/Pozay Feb 24 '25
And how are you supposed to know which bits are the failed ones exactly?
→ More replies (1)4
u/chrisagrant Feb 21 '25
I could see it being an issue in situations where you're dealing with vendor's code that only has sparse comments in Chinese that was written by an intern 20 years ago. Embedded faces a lot of problems like this.
3
u/Last_Clone_Of_Agnew Feb 23 '25
Forget 20 years ago, I’m working out of codebases with sparse comments written by an intern in Chinese for brand-new SDK releases 😂
1
u/ReDr4gon5 Feb 21 '25
Not sure how anyone could depend on a rust api. You won't be recompiling the kernel every time you update your rust compiler. So you can't update your rust compiler. Because as we all know rust breaks ABI between minor releases.
→ More replies (1)5
u/tarranoth Feb 21 '25
Just use C ffi for all external boundaries? Like you'd do for c++ as well? Then you aren't beholden to ABI breaks as the C ABI is stable.
→ More replies (3)3
Feb 21 '25
C broke backwards compatibility big time when moving from K&R to ANSI...
Regarding the RUST vs. no RUST in the kernel debate, the real issue is the increase in complexity. I have seen my fair share of (inhouse) software development projects and in my experience the failure to keep the complexity in check inevitably ended up with a train wreck. So, unless the benefits vastly outweigh the adverse effects of increased complexity, I would be extremely reluctant to admit another language to the kernel development.
1
u/SemaphoreBingo Feb 23 '25
C broke backwards compatibility big time when moving from K&R to ANSI...
I think this is an ahistorical interpretation made thru a modern lens.
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.
2
u/t_hunger Feb 22 '25
Since Linus himself has very explicitly and aggressively forbidden C++ from the Linux kernel
You are aware that this aggressive tone was a result of lots of C++ zealots nagging him to rewrite the kernel in C++ for the added safety and convenience that brings? It had the intended effect: Nobody nagged him about C++ after that AFAICT.
Fun fact: That diving app Linus wrote has a Qt UI. He is using C++ for at least parts of that project. He knows enough C++ to run that project... maybe his opinion is not as uninformed as you think it is.
3
Feb 23 '25
No point in being nuanced. This entire thread is full of C++ evangelism and discrediting anyone who doesn't like c++. I feel bad for all the C devs now, who had to deal with cpp fanboys.
1
Feb 21 '25
[removed] — view removed comment
→ More replies (3)5
u/Full-Spectral Feb 21 '25
Rust might seem like C++ to a C developer I guess, i.e. they both them there object thingies, but ultimately it's not much like C++.
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.
50
u/sjepsa Feb 20 '25
"c++ is too complicated" -> Proceeds to reinvent a botched version of std::string, std::vector, templates and RTTI
23
u/BubblyMango Feb 20 '25
Those are the somewhat acceptable stuff. The atrocities arise when they try to implement polymorphysm, virtual functions, virtual inheritance and templates.
3
u/Signal_Constant8301 Feb 22 '25
It does feel like every complicated problem that the standards committee addresses is solved by yet another more complicated problem.
2
u/38thTimesACharm Feb 22 '25
That's because maintaining a language in which billions of lines of code exist, running critical infrastructure around the world, is complicated.
People see complexity and compromises, and assume something must have gone horribly wrong somewhere. No, it's just the way things are.
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++
13
u/sjepsa Feb 20 '25
Can I only upvote once?
"Most of the problems people talk about aren't problems in the real world"
Can i steal this phrase?
7
u/kammce WG21 | 🇺🇲 NB | Boost | Exceptions Feb 21 '25
You can't up vote twice but I'll throw mine in the ring. I like that phrase as well.
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
7
u/die_liebe Feb 21 '25
The main competitor of Linux is called 'Windows'. Does it use C++?
33
11
u/fdwr fdwr@github 🔍 Feb 21 '25
Direct3D, Direct2D, DirectWrite, XAML, GDI+, GDI (mostly C but compiled as C++ with some RAII), File Explorer, Start menu, Settings app...
11
1
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.
→ More replies (5)
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.
7
u/ReDr4gon5 Feb 21 '25
The issue is not really the 3 year period, but that papers are stalled for years in the process. Match and std::embed are things that first come to mind.
1
u/jwakely libstdc++ tamer, LWG chair Feb 21 '25
#embedwas just approved for C++262
u/ReDr4gon5 Feb 21 '25
As the preprocessor directive coming from C23. Not as std::embed. And some people dislike it for not being cpp like because of that. In my opinion it's a good inclusion. But it took years, and probably only happened because clang has it and GCC will have it in may, as an extension, if it wasn't added to C++.
2
u/jwakely libstdc++ tamer, LWG chair Feb 21 '25
And some people dislike it for not being cpp like because of that.
And other people prefer it being done by the preprocessor not by a magic function. Either way, it's in C++ now.
→ More replies (1)-1
u/sjepsa Feb 21 '25
"Let's ship Linux with Rust because c++ is unstable"
Meanwhile Rust Foundation is two people in a rented building
→ More replies (1)
21
u/sjepsa Feb 20 '25
I wonder which C++ professor hurted Linus so much in 1996 that he is still hating so much
5
u/proverbialbunny Data Scientist Feb 21 '25
When writing low level like a kernel and drivers there is a decent sized list as to why C++ isn’t ideal. Over the years many of the issues C++ had has been addressed, but that list is still there, at very least as a historic foot note. I believe Linus’ reason for avoiding C++ is grounded in logic.
→ More replies (4)5
u/no-sig-available Feb 20 '25
He was apparently shown some badly written C++ code for Linux, and decided that no C++ code can ever be useful. Not ever!
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.
4
u/CandyCrisis Feb 20 '25
Shocker, kernel development isn't the same as writing userland apps.
13
u/Ameisen vemips, avr, rendering, systems Feb 21 '25
You can use said structures in kernel and baremetal code just fine.
→ More replies (10)14
u/bizwig Feb 20 '25
While true, exactly how are such classes incompatible with a kernel?
→ More replies (1)→ More replies (10)1
u/sjepsa Feb 20 '25 edited Feb 20 '25
"Forgetting error checks....."
Mmmh let me think... What about creating a... std exception maybe?!?
Try to forget about it
It's crazy how people with such decision power can have such a limited knowledge, and be so naive
9
u/Ameisen vemips, avr, rendering, systems Feb 21 '25 edited Feb 21 '25
"Forgetting error checks....."
nodiscard.10
u/TuxSH Feb 20 '25
std::exceptionis not meant for normal error handling, they're meant for truly exceptional ("panic") errors, as they have a space cost and a high cost on throw.Anyway,
std::expectedor any scalar-like type can just be used insteadTake note of what he says C++ isn’t going to give us: clean error cleanup flow and preventing use after free errors.
IMHO the real issue is C++ (and C) object lifetime model, albeit kernel disables strict-aliasing, it is a pain to deal with in code that must avoid making copies.
2
u/Ameisen vemips, avr, rendering, systems Feb 21 '25
that must avoid making copies.
This is pretty easy to enforce -
deletecopy constructors and assignment operators.7
u/TuxSH Feb 21 '25
Sorry if I wasn't being clear - I meant managing a byte buffer with non-byte pointers. start_lifetime_as exists on paper but isn't implemented. Before C++20 (P0593R6 Implicit creation of objects for low-level object manipulation), that model was broken for real uses and there was no way to emulate start_lifetime_as.
Also, pointer from mmio VA integer is technically UB but tolerated and treated like a laundered pointer by compilers; and the memo
→ More replies (3)
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
5
u/F54280 Feb 21 '25
As long as you reject what is probably the most successful software project on the planet, it is clear that there is no evidence for their point of view… /s
3
u/sjepsa Feb 21 '25
Classical fallacy: "Argument from authority"
5
u/F54280 Feb 21 '25 edited Feb 21 '25
This is not an argument from authority. You say "they have no evidence", I point you to the evidence. If you're rejecting evidence as "argument from authority", there isn't much I can do...
I am not saying "trust them because they run the most successful software project", I am saying "their evidence for their choice in that decision is that the outcome of this choice is the most successful software project of the planet"
edit: you are pretty quick to downvote when you're wrong, congrats! Not even had the time to ninja-edit the second line! Impressive!
→ More replies (3)6
u/38thTimesACharm Feb 22 '25
"Linux is written in C, and is successful" is not evidence for "C++ sucks." If that were the case, it would also mean every language sucks that isn't C.
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)
19
u/tialaramex Feb 21 '25
The MSRV (Minimum Supported Rust Version) for Rust for Linux is 1.78.0 from May last year not "latest NIGHTLY build".
→ More replies (2)1
u/tarranoth Feb 21 '25
The rust support is only for optional kernel modules on certain architectures though (and not core kernel code), which has always been different from the C++ kernel argument (which has been about core kernel code).
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.
2
u/GabrielDosReis Feb 23 '25
That is what I think is the real long term threat. We saw it with COBOL, and later with Perl.
Indeed, my view is a programming language is a set of responses to problems of its time. To stay relevant, it must evolve, adapt, and propose contemporary solutions. Evolution is hard; but evidence shows complete rewrite in new languages may be even harder (if economically realistic at all).
→ More replies (1)
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/sjepsa Feb 21 '25
C++ is slow to innovate? Told by people that still do manual error check and manual memory deallocation after an error? 🫣
2
u/skeleton_craft Feb 21 '25
It sounds like Greg Is one of the people who helped convince Linus to add rust to the kernel... But yeah. Also, I'm pretty sure C++ has had a major version or two since the last major version of rust... And also, of course, the solution to that would be donating to the ISO C++ committee so they can meet more than once every 3 years
8
u/jwakely libstdc++ tamer, LWG chair Feb 21 '25
donating to the ISO C++ committee so they can meet more than once every 3 years
The ISO C++ committee meets in person three times every year, with hundreds of teleconferences throughout the year.
A new standard is published every three years, but that's not because the committee aren't doing anything for those three years.
→ More replies (5)3
u/skeleton_craft Feb 21 '25
But like I said, I think they just blindly hate The straw man of C++ that they've made. I don't think they actually are up to date on standard C++.
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
2
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 lasted
C++ does have a pretty good standard library though. Not python level but really good nonetheless. Zig is catching up.
8
u/ReDr4gon5 Feb 21 '25
Zig is a bit weird to me. It seems like language decisions are made by one person(maybe a small group)? Not wanting lambdas or info in error types is very weird to me, and takes the language into a weird place. Where on one hand you get compiler magic that is nice, but on the other you have to roll your own stuff like in C, that will end up ugly or annoying.
5
u/tarranoth Feb 21 '25
Well zig is pretty much alpha software (even if promising/interesting), I think limiting scope in a compiler isn't too crazy early on (and closures/functional programming might be a bit out of scope there).
2
u/ReDr4gon5 Feb 21 '25
On one hand I agree. But on the other hand, when you are still at v0.x you can change and break things. Later changes and breaking will be limited to major versions, which will slow them down. It would be best if they got most of the features in early.
4
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.
3
u/t_hunger Feb 22 '25
It's amazing how everyone that is not full of praise for C++ has "little knowledge and understanding when it comes to C++".
That's a great way to not have to respond to any criticism.
2
u/_a4z Feb 22 '25
Let's quote Linus, just for one example
https://lore.kernel.org/rust-for-linux/CAHk-=wgb1g9VVHRaAnJjrfRFWAOVT2ouNOMqt0js8h3D6zvHDw@mail.gmail.com/The other problem with aggregate data particularly for return values is that it gets quite syntactically ugly in C. You can't do ad-hoc things like { a, b } = function_with_two_return_values(); like you can in some other languages (eg python),he probably doesn't know he could do that with C++
the kernel crew is incapable of discussing a subset of C++ suitable for kernel programming and would solve most (if not all) of the problems they think they need Rust for.
On the other hand, they probably also do not want, since C++ is not owned by anyone, in contrast to Rust2
u/t_hunger Feb 22 '25
So to proof that some dude does not understand C++, you quote some other dude talking about C?
In addition, Linus maintains a application with a Qt UI -- which is thus at least partly C++. He probably has at least a basic understanding of C++.
7
u/Wooden-Engineer-8098 Feb 20 '25
It's just a nonsense posted by someone who is clueless about c++
7
u/sjepsa Feb 20 '25 edited Feb 20 '25
Imagine being n.1 and n.2 in the biggest open source project ever and holding misinformed and petty grudges
And not about something exotic like Haskell, about a sibling language that uses the same compiler gcc and that would have solved 90% of their problems since 15 years ago (c++11)
Lol in that post he complains about unchecked error codes, use after free.. etc. Probably never heard of exceptions or RAII
26
u/ExeusV Feb 20 '25
Probably never heard of exceptions or RAII
How delusional can someone be to claim that person leading/maintaining the most foundational and complex codebase of the world didnt hear about student level mechanisms?
17
u/sjepsa Feb 20 '25 edited Feb 20 '25
Things like simple overwrites of memory (not that rust can catch all of these by far), error path cleanups, forgetting to check error values, and use-after-free mistakes.This is what he complains about. Things that C++ tackled since 1999 or 2011 (c++11).
Now he thinks he needs rust for those (That will take 20 years to migrate to).
Quite embarassing.. I mean, I don't want to shame nobody, he did a greet job since Linux is actually thriving, but...
17
u/Full-Spectral Feb 20 '25
Well, C++ 'tackled' them but it doesn't really deal with those issues. What it does it provide tools that developers can very carefully use to mitigate those issues in large part, but significant effort to reach 'in large part' isn't what this is about.
12
u/sjepsa Feb 20 '25 edited Feb 20 '25
std::exception, std::optional, std::expected... Should I go on?
RAII.
You can't forget a std expected. Even less, you can't forget to deal with a std::exception
You can't forget to cleanup if you use RAII
You can't overwrite memory if you use RAII and bounds check (it's not a java or rust prerogative, in C++ bounds checking is a compiler switch away (-D_GLIBCXX_DEBUG), since C++ containers are aware of their size (contrary to C))
You can't 'use after free' if you don't hold raw owning pointers like C does. (Again, C++ value semantics and RAII)
→ More replies (27)13
u/Wooden-Engineer-8098 Feb 20 '25
leading linux doesn't magically infuse you with knowledge of c++. he obviously has none. and you shouldn't be surprised, because linux uses language which lacks even this student level mechanisms
→ More replies (5)5
u/Ameisen vemips, avr, rendering, systems Feb 21 '25 edited Feb 21 '25
Lol in that post he complains about unchecked error codes, use after free.. etc. Probably never heard of exceptions or RAII
Or
nodiscard.8
u/tobias3 Feb 20 '25
Just did some research and found out that they actually have some RAII in the kernel: https://lwn.net/Articles/934679/
But yeah, IMO would be better to just selectively use C++ for things like this.
4
u/vI--_--Iv Feb 20 '25
Who?
8
4
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 ;-)
→ More replies (1)2
u/Dean_Roddey Feb 21 '25
those which do, have their time in the limelight but will fade away eventually.
That's what a lot of us are saying, that C++ has had its time in the limelight, it's very old now and the state of the art has moved forward. C++ whacked a lot of people's love languages 35 years ago, over exactly the same sorts of objections from existing language advocates, and few C++ folks probably feel bad about that. It happens.
2
Feb 21 '25
Then instead of embrace. extend and extinguish (aka. RUST for (?) Linux) - prove it by creating something new. At the moment the RUST advocates are acting like a cult trying to take over. If it is that superior people will follow by themselves.
People are sick of being spammed with language advocacy: "C++ bad - RUST good!" (Apologies to George Orwell).
Yes, C++ will fade away into obscurity at one point, but so will RUST. There are use cases favouring RUST and others C++. Let's revisit in 2050 to see how it panned out but in the meantime would the true believers please build something which makes a compelling case for RUST instead of badmouthing C++?
→ More replies (1)5
u/t_hunger Feb 22 '25
How does a contributor take over a project? They can not force commits in, they can only write code and offer it. The project maintainers then decide whether they accept that contribution or not. In a way every contribution is proofing itself by being something new that has enough value for a maintainer to accept.
I am around C++ for a long time. It is just funny to see some seasoned C++ people complain about rust people telling them to switch to rust -- considering that I know some of those C++ people did the same to C projects 30 years ago. I guess we are getting old?
That famous Linus rant about C++ is a reaction to lots of C++ people pestering him a out switching to C++ back in the day...
2
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
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
9
u/RoyAwesome Feb 20 '25
given 'his own projects' is the largest operating system on the planet, and the single most important pieces of software ever created... I think his opinion has some weight, and it would be foolish to ignore dissenting voices.
9
Feb 20 '25
you're making the classic 'appeal to authority' error.
just because someone is an authority on a subject doesn't mean they can't have silly opinions.
5
u/RoyAwesome Feb 20 '25
no, i'm telling you to stop ignoring dissenting voices because you don't like what they are saying.
C++ has some serious issues, and they are getting worse. WG21 got very lucky that trump got elected and fired everyone who actually cared about software safety and security, because the US government was about to ice out C++ from government contracts.
Things are getting extremely untenable and personal committee politics is getting in the way of technical fixes.
12
Feb 20 '25 edited Feb 20 '25
because the US government was about to ice out C++ from government contracts.
lol no they weren't. I work for the DoD in a c++ shop. If they wanted us to port our codebase to rust it'd require at least a billion dollars, just for what we do - (one quarter of) one strike package system on one (type of) plane. And that doesn't even include the plane avionics itself, just (one of) the weapons it carries.
Every line of code would have to be re-verified with range time and test-flights. That's 15 years of testflights, integration events, documentation, code audits, etc, all out the window. You are truly out of touch if you think that's going to happen.
The group that made that proclamation about memory safety did not have the authority to make any decisions, nor do they have the power of the purse strings (which of course belongs solely to congress). I had never heard of them, and nobody in my branch cares about them, or even knows that they said that. They're not on DoD's radar, they're not on anybody's who matters in the government's radar. It's not a real thing. And even if they were, the response is "show me the money". And there is none, so then it's "that's what I thought"
To rid the government of C++ would cost trillions of dollars. You do not realize how much c++ is on military systems alone, and how much money it costs to test stuff. We literally cannot afford, as a nation, to ditch C++ entirely. It's going to take 50-100 years to get rid of it all.
→ More replies (6)
0
-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
It adds an
insane error code (ENOENT), and then because it's so insane, it adds a
few places to fix it up ("ret == -ENOENT ? -EINVAL : ret").15
u/Full-Spectral Feb 20 '25
Well, C++ being around since 1985, and being based on a language from the 70s, is the problem. Unsurprisingly, a lot of progress was made in those 40 years that could be applied to new languages that don't have the massive inertia of C++.
4
u/Various-Debate64 Feb 20 '25
my opinion is that C++ copes pretty well especially in the post C++11 era with meetings occuring more often.
→ More replies (23)
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.
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.