r/cpp • u/domiran game engine dev • Mar 29 '26
Can I rant for a minute.
Call me weird but I think the majority of C++'s issues stem from one very fundamental problem: the language cannot evolve because everyone is against both breaking ABI and changing core language features. Yes, this is another one of these posts. Allow me to try something new.
I think everyone already knows how we got here and this is what's driving me nuts. I don't understand why there hasn't been a push to actually solve it. Like, actually push against the entities that are against breaking ABI or updating the core language and allow the language to actually move forward instead of tiny baby steps. As Bjarne has said, there's a better, less-complicated language inside C++. We'll never see it with our current self-imposed limitation. It is clearly a self-imposed limitation and quite frankly I find it ridiculous we're still here. It's not like C++ is the only language and other languages haven't found a way around this issue with one solution or another. (The PHP7/8 debacle comes to mind.)
Against all reason, I love C++. Don't ask me why. I've been using this frankenstein language since I think the early 90s. I continue using it now and have written a (very playable) 2D game engine with it. And, as with any experienced C++ programmer, my issues with the language are numerous. To name a few:
- I think vector, string, and a few other STL types should have been baked into the language.
- We have way too many ways to initialize a variable.
- Argument passing is unnecessarily complicated compared to other languages.
- The h/cpp compilation model is a dinosaur.
- Why did we get copyable_function instead of function2? Or just update function to begin with? Let's not even get into that discussion.
- Modules seem almost terminal upon arrival. (Yes, I've heard both that they are basically usable now, and also that the spec is fundamentally flawed.)
- People are already complaining about reflection including STL headers because it needs vector. Don't even get me started on the prospect of something like refl_string and refl_vector.
- Destructive moves.
Let me know in the comments if I didn't include your favorite issue.
C++ has had some very nice evolutions. C++11 was great. Reflection will hopefully be a great addition. (Modules was supposed to be a great addition but let's not go there right now.) But there are so many competitor languages at this point it's just bonkers there are few or any attempts to solve the fundamental issue: C++ cannot grow because it cannot get out of its own way. Would C++ have so many flawed (map/set) or downright unusable features (regex) if there was a feasible way to go back and fix them? As an aside, I tried using std::regex in a utility for my game engine. At this point it would likely take over 2 minutes to execute said utility. Using CTRE, it executes in just a few seconds.
I honestly think it's no secret why Circle, Rust, and Go exist. Would they exist if C++ had an effective -- or at least, agreed-upon -- way to break ABI? (Or, ISO forbid, breaking ABI wasn't necessary by some means.) I have doubts about the feasibility of something like std::network because if one security hole is found that affects ABI, the whole thing becomes basically permanently unusable. Something like std::gui would also be dead upon arrival.
C++ specs get one chance to get it right. If they don't -- and unfortunately the rate is not 100%, which is unattainable anyway -- it's extra complexity in the language that is, for all intents and purposes, a "noob trap". I think this is dumb. I can't be the only one. I have to imagine this "we must get it right on the first shot" is also what makes passing a new paper outrageously difficult.
I really don't want to hear "we can't because breaking ABI would break tons of applications". I still think it's a self-imposed limitation, and it is time to recognize the heavy damage it's done to the language. You're limiting the evolution of the language to the extreme detriment of its usability. I personally cannot overstate this. The solutions are many, and if it comes down to "every major C++ release is an ABI break" so be it. C++'s technical debt is piling up and its complexity grows to a ridiculous degree with every half-solution. I wouldn't be surprised to see C++'s usage fall off a cliff because the basic problem is its barrier to entry is too high.
I haven't used C++ nearly as long as some but I'm already really tired of this awkward compatibility dog and pony show. We know why the competitor languages exist: primarily to fix issues in C++ that could very well just be addressed in C++ instead. There's a lot of smart people inside (and outside) the C++ community. For our own sanity, I really think it's well past time to put together a team of people to address this instead of giving us reflect_only_function. At least some of these problems are quite down to the fact that many things that, in my opinion, should have been language features were instead of implemented as library features. vector<bool> could long have been addressed if it wasn't in a header.
I'd love to help solve this problem, but I'm only one person and I'm by no means a C++ expert (given the famously high skill ceiling of C++) but it affects my day to day. I really wish C++ could actually start picking things off its wish list instead of continually punching itself in the face (see 8-point list above). I'm not going to list what I think C++ should do with breaking changes because not only can we not agree on breaking compatibility, we can't agree on how to consistently name things. I don't know what the solution there is but I do constantly wonder if awkward naming could also be fundamentally solved by allowing breaks. Maybe then we wouldn't have "copyable_function" because it would just be "function".
[Edit]
Some additional comments from the comments.
- I'd like to see the conversation move from "should we" to "how do we" and find out if any solution can make everyone at least sort of happy. The obvious common answer is breaking compatibility at every major version but clearly that makes the larger entities very unhappy. (Part of me wonders if they should have such control -- to the detriment of others, in some cases, if it is "for the best" -- but that's whole other discussion.) The other obvious common answer is epochs. But simply arguing "should we" I think is a waste of time. I personally think it's a damn shame the epochs paper was (if I remember right) turned down rather quickly. It was, at least, a starting point. At the very least, defining what you'd want out of a C++ versioning system would be nice. Perhaps modules was a poor starting point, given how long it's taken for them to become usable.
- There are a number of things in the language that are fundamentally flawed to the point they are basically unusable. (For me, if this number is higher than 1 it is to high.) This fact tends to get swept under the rug because we can never go back and fix them if the change involves syntax or ABI. Regex is really quite bad. It is not the only thing. It contributes to the difficulty in teaching the language.
- Yes, C++ really has some awful defaults and traps. Debating whether auto should recognize "T&" returns, automatically preventing a copy, is always a fun discussion. Boy, would that cause a disaster if it were to be changed.
- To the original readers: yes, I'd like to see both ABI and core language breaks. I've modified the post to make that clear. Perhaps we could start with one of them. ABI breaks are clearly harder because it affects dynamic linking.
- I've never been to a C++ committee meeting but I just want to point out again: would we have such awkward naming for some things if breaking changes to the language or ABI were allowed? Is the sole reason copyable_function exists because we couldn't change function? Point is: ignore the discussion on the name and instead specifically if the change should have simply been to function in the first place.
85
u/jwezorek Mar 29 '26 edited Mar 30 '26
A lot of this is fair, but I do think you are using “reluctance to break ABI” as a stand-in for the entire legacy burden of C++ as a major, complex 40-year-old language. That is, even if everyone woke up tomorrow and decided we were willing to break ABI, are we also willing to break huge industrial codebases? Are we willing to compromise zero-overhead goals? Are we willing to weaken compatibility with C? And so on.
Put another way: a year ago I went to the eye doctor because I thought something was wrong with my eyes. The doctor told me what was wrong with them was that they are 50 years old. That is C++’s problem too. It is old, and unlike Latin or Fortran or COBOL or whatever, it is still under heavy day-to-day use. Rust will have this problem too in 20 years.
92
u/TheRealSmolt Mar 29 '26 edited Mar 29 '26
I have no intention of getting into a heated argument, so I will almost definitely not reply to any comments to this. This is also not an issue I have had a strong opinion on at all, so I'm just going to say my initial thoughts; take it with a grain of salt, they might be half-baked.
I think you're trying to turn C++ into something that it's not. You want to break the language so that we can get new features, sure I get that; however, you want those features so that it can try to be languages that already exist? It's not a competition, languages are tools. And, at least from my perspective, having the stability and compatibility that C++ does is a significant feature critical to it's purpose. Yes, it's a pain, but it's a trade-off with benefits of its own, just like countless others.
Yes, C++'s technical debt is ever-growing and it's making the language complicated. However, if you want to break it, you might as well just go all the way and jump ship to a new language better suited to your needs. That's essentially what you're arguing we should be doing with C++ anyways. C++ doesn't have to be the answer to your problem.
In essence, I think you're being a little short-sighted and too easily brush off the consequences and trade-offs of this, which is understandable considering how long this unsolved debate has been plaguing the language.
8
u/m-in Mar 30 '26
I may be having a senior moment here, but is there any reason to sweat over intra-C++ ABI? Don’t people compile the whole project anyway? Does anyone actually use precompiled libraries in big projects - and if they couldn’t, would anything change? For the codebases that concern industry, any sort of a framework they may use (Qt, boost, …) should be compiled from source anyway. The code that uses the framework dwarfs the size of the framework. So, who does care about ABI?
And even then, it’s not like everyone needs to compile boost from source every day. Keep the dlls until the next ABI break.
Sure, having a way to interop with C is not optional, so preserving that is what makes C++ what it is. But that’s only a small boundary to keep perpetually in peace.
It’s super early in the day for me and I haven’t had my caffeine yet, so I may be missing something obvious. It’s just that ABI within C++ proper has never ever entered my mind. It wasn’t a concern, not because it was cast in stone and stable, but because in practice if it changed nothing would really change in how I write or build C++.
24
u/AKostur Mar 29 '26
Where’s the “new” part in there? That’s all the same tired, old rant. Plus, the language has evolved quite a bit. Just not in the specific ways you seem to want.
26
u/kevinossia Mar 29 '26 edited Mar 29 '26
There's a disease of the mind in the systems programming community when it comes to backwards compatibility.
I recall having a discussion about CMake and why it's so horrible. The issues are caused by exactly the same stuff that plagues the C++ language: a bizarre commitment to backwards compatibility.
Basically when it comes to this stuff people have two choices:
Basically when it comes to this stuff there will always be pain for those involved. The only question is do you make everyone suffer the pain, or just the people looking to update from their ancient version of C++98 or CMake 2 or whatever?
Well, turns out both C++ and CMake have taken the second approach and here we are.
3
u/PipingSnail Mar 30 '26
There are, according to Google, 16.3 million C++ developers worldwide, and about 6 million software QA testers worldwide.
How many hours are going to be consumed across all the multiple codebases these devs work on, porting the code to the new ABI, then testing and verifying that code works?
63 hours per dev? That's a billion hours... just for the developers and nearly 400 million hours for the qa testers. That's nowhere near enough time...
How much is that going to cost?
How many applications are going to ship with ABI problems that got through testing?
Do you think AI is going to make this problem go away? Or perhaps AI will make people complacent about the true nature of the problem?
8
u/slithering3897 Mar 29 '26
std::array. I'm not sure about dynamic arrays. Really, it's the dinosaur C-style array that's the problem. You'd put dynamic containers in the language just to avoid template instantiation overhead.What languages is there to compare to?
Already solved. In the standard at least... But headers will still be useful for macros (and you can still import in a header).
My biggest beef with VS right now. Basic super-obvious Intellisense bugs they just can't be bothered to fix, and I'm still waiting on some build bugs. Maybe they're waiting on EDG, but then communication would be nice. Because we've been waiting for YEARS.
And in my testing, modules won't reuse template instantiation enough to make
std::printfast. The compiler will still regenerate all the same code.But at least the standard is fine, except that little bit about
/internalPartition.It may be possible to write your own darn language faster than it would take MS to implement C++26.
Doesn't matter, use
import std(once it works).Maybe in VS2030 if you're lucky... Finally get rid of
[[msvc::no_unique_address]]?I think VS should just break ABI every major version.
And MS should fix the platform ABI to allow passing
std::string_viewin two registers, and stop returning trivial structs by pointer just because they have a user-defined ctor.10
u/tialaramex Mar 29 '26
Let's address just a single item, "I think vector, string, and a few other STL types should have been baked into the language"
Both
std::vectorandstd::stringaren't very good. They're not terrible, but they could be better. So presumably the "baked in" types would be similar but now they're baked into the language, which is doubling down on a mistake - even before we stop to notice that these are allocating types but C++ wants to be a freestanding "bare metal" language so must not bake in such types.What C++ should have baked in, because it's easier to get right and more important for almost all software is the associated non-owning slice reference types, which C++ named
std::spanandstd::string_viewwhen it finally got around to defining them. Those make sense baked in and indeed Rust's equivalents&[T]and&strare baked in to the language.49
u/38thTimesACharm Mar 29 '26
I could flip this around though. Would C++ still exist, if updating it was just as hard for users as switching to another language? If that were the case why wouldn't everyone just use the newer languages?
Not saying C++ should literally never break ABI or that I've even thought about this much. But when comparing C++ to other languages, people incessantly consider legacy/compatibility to be purely a weakness, when in reality it's a weakness and a strength, and changing that requires carefully considering the tradeoff.
3
u/eej71 Mar 29 '26
To add on what others will likely highlight, I think in order to get movement in the direction that you want, you'd have to really wrap your head around - what is the value that people DO receive TODAY from avoiding the various flavors of actions that fall under the singular title of "ABI breakage".
From your stand point, you feel denied key values that are just within your reach. You can see them! You can taste them! But argh! They remain forever locked in a glass case that says do not touch. Like some pretty piece in a museum. A race car you can never have.
I think to get through the "API breakage", you'd have to understand and help others navigate the costs they experience with traversing the chasm that come with such breakages. To further complicate things, even trying to get a consistent understanding of what breakage even means and how it plays out is quite complicated. It's not easy!
But I think it begins with expanding your horizon of understanding.
3
u/Charming-Work-2384 Mar 30 '26
C++20, C++23, C++26... where has the language stagnated?
Have you seen any other language growing ... in depth and spread... that with such a discipline?
Java came to replace C++, but died.
Python came, died.
Now there is big noise of Rust, ZIG etc. Etc...
Colbol, C, Fortran are still living...why? They too are "oldies" but never competed with C++, all these including C++ co-existed peacefully. Its only with Java when we heard that C++ will die... ... java did instead.
They too will die in few years.
Reason? Try writing 1,00,000 loc in them you will die ...too...
C++ is an all encompassing language, yes it big and in some cases bit weird... but to write an enterprise level code, no other language can match it. Period.
Lets understand it, and start writing simple code to get to the bottom of it..
Why is that C++11 code continue to exsist? because the "coporation" that has that huge code base just dont want to mess with it... because the developers have either left, died or have become managers now. That is a sad part.
Else..
C++ is still an emperor.
1
u/Xeromycota Mar 30 '26
What is the equivalent of C++2? Or it is C+++?
1
u/RumbuncTheRadiant Mar 31 '26
Sadly, that's not a language problem.
That's a "Late Stage Capitalism" problem... see r/LateStageCapitalism for more details.
Me personally, I don't give a rats arse about ABI compatibility and would break it in a heart beat.... I could then get rid of that immensely painful black box proprietary library in the middle of my day job that makes my working life miserable every day.
But the owners of the source code for that horror will charge a fat fortune to move the older versions forward and recompile.
All that said, I find modern compiler warnings absolutely amazing. -W -Wall -Werror is a very much different very much safer language compared to what we had pre Y2k.
Personally I can't see any major advances from ABI breaks... do you have any examples?
On naming... I'm actually all for sweeping breaking changes... IF AND ONLY IF THEY CAN BE SAFELY AUTOMATED.
..but that opens some quite large opportunities.
And again, I'd be happy with safe automated migration is available if your code compiles to "very unsafe and dumb operations that were allowed previously are errors" level of warnings.
Why?
Because every time I turn on a higher level of such warnings.... I find bugs and fix them.
Every time.
1
u/PrestonBannister Apr 01 '26
Imagine that you spent a couple years building a high-performance and mission-critical application. You have an entire suite of unit and regression tests, and your error rate is down to near zero. In the field, hundreds of sites are in daily production, performance is superbe, there are months between bug reports, and no backlog.
Now imagine a new version of C++ comes out, and the application no longer compiles. There are tons of warnings, which as you dig through them, turn out to be meaningless.
Do I wish there were a better version of C++? Yes, I do.
Do I think this new language should be called C++? Not so much.
I have used C++ slightly longer (compiled cfront early on), and have never been a fan of the C++ standards committee. While I do like some of the recent changes in C++, I am much less convinced about ... quite a lot.
At this point C++ is a Frankenstein monster, and will never be a supermodel. :)
1
u/furyfuryfury Apr 03 '26
I'm a fan of C++. It's possible to craft truly elegant, tight, maintainable, performant code. At the same time, it's also a chore to maintain, especially the more sophisticated your dependency graph. Conan does the best it can, but it can only go so far as C++ lets it. Headers suck big time and I hate every minute I have to edit them. I get it, it saves from having to do two-pass compilation, but the cognitive overhead has me gritting my teeth every time I shoot myself in the foot with a header mishap.
I love C++ and I want it to keep improving. What I don't like is the idea of turning it into yet another handholding language that doesn't let you do crazy machine-language-level tricks when you need to (memory is tight, e.g. embedded, or latency is king, e.g. audio). Modern C++ is perfectly capable of evolving to solve all these problems. I can't say I'd have time to participate in a committee, I'm often so busy working on cleaning up my own messes that I can't think about ways to clean up C++'s, but maybe it's worth a thought as to whether it's time for a so-called C-- which strips away the legacy for the sake of moving into the future. I don't know that I really need to keep being able to compile C++ from 25 years ago. There's always the idea of keeping around an older version of the compiler.
If dropping some cruft makes for a more nimble language, that still has all the modern niceties I've gotten used to in the last 5-15 years, I'm for it.
Tell me how to support the effort and I'll do my damnedest.
3
u/zirconium_n Mar 30 '26
TBF regardless whether the change is good or not, I don't believe the change will ever happen anyway. Either use another language or just take what C++ has. It's a lost fight.
3
u/FKaria Mar 30 '26
I don't get what would be the point of breaking the language in this half-assed way. Rust exists already.
1
u/Wooden-Engineer-8098 Mar 30 '26
What makes people fail to understand that by making incompatible language you are making different language? Stop calling it c++. There's a lot of different languages, just pick any and use it
10
u/kronicum Mar 29 '26
There are two kinds of languages: the one people complain about, and the one nobody uses.
1
u/vI--_--Iv Mar 30 '26
The most ludicrous thing about ABI is that it does not even exist.
Yes, you've read that right, it does not, and never did, and never will.
The standard does not define it.
It is different between compilers.
Unlike C ABI, it was never guaranteed to work forever.
Unfortunately, certain compilers dominate on certain platforms.
So way too many people falsely believed that "if it works on my machine now, it will work forever everywhere".
And certain vendors do not want to change anything, because doing so would break that already broken code and upset people that shouldn't have written that code in the first place.
But since the committee is vendor-infiltrated on every level, these false beliefs are now the objective reality.
Don't waste time explaining to "the committee" that it's time to break ABI.
It does not have a say here.
Talk to your vendors.
1
u/wannaliveonmars Mar 30 '26
C++ is a language with a massive legacy codebase, so any new version is constrained by the fact that it can't break old code that's already been written, or people won't adopt it.
1
u/Matk3z Mar 30 '26
Is this not okay to just let the language die in the long end? I mean, if cpp is so broken and burdened with that much tech debt maybe the best solution is not to fix the language?
Completely changing the language (break ABI, core language, etc) will only mean that the huge industrial code bases needs to be more or less rewritten. So instead of working on the herculean task of « fixing » cpp. Shouldn’t we just move forward to other technologies and language?
Breaking cpp into more specialized languages is not necessarily a bad thing I think. Learning a new language is not that hard (and if the new languages are less broken than cpp it’s really not that hard actually). For example (take it with a grain of salt I don’t want to start an heating debate about actual technical solutions) we could have Go for very high level and speed, Rust for memory safety and idk zig for the lowest level of cpp.
All technologies are not meant to be fixed imo. If we fix cpp and it requires people to rewrite their code bases maybe they should rewrite their code bases in a language that is not fundamentally broken directly.
Being a junior embedded eng I learned many languages in surface (js, C#, java, etc) and some other a bit deeper (C, Cpp, Rust) and cpp has been the most abnoxious by far. The 10 pages long error message for templates is such a turn off for me.
4
u/za419 Mar 30 '26
Yeah, I work with legacy software that still rigidly targets C++11 (and I was the one to push the first C++11 only a couple years ago!), and treats increasing the major version as if it were an ABI break, despite the fuss about ABI breaks in committee.
In my opinion, having a libc.so.7 and demanding gcc can compile against either the new or old ABI depending on the version at hand is a much smaller sin than never being able to upgrade the language at a fundamental language.
Now, do I necessarily agree that it's just about the ABI break and if we could all agree on that we'd be golden? Not really.
But I do think at this point we might need to do the XKCD 927 thing and have a C+=2, which is superficially compatible with most common usages of C++ but willing to break things in well-described ways for its own good (a la Python 3, as much trouble as it caused).
Frankly C++ is dying. Not in the sense that it'll be gone and no one will use it in ten years, but in the sense that there's a pretty strong and well-reasoned movement to stop using it for new projects and start rewriting things to Golang or Rust when you're doing lots of work with a C++ codebase anyway.
2
u/johannes1971 Mar 30 '26
I used to care about ABI stability. But I've changed my mind. ABI is set in stone, and I will not bend myself into twists to do it 'proper' when I can just throw std::string to a DLL and have it work. Is it dodgy? Sure. Do I care? Not anymore. If ABI is set in stone, I will program against that standard.
2
u/Liam_Mercier Mar 30 '26
Maybe it's just stockholm syndrome, but these problems just don't really bother me.
3
u/ContraryConman Mar 29 '26
This is such a common take that Google made a whole new language called Carbon, instead of continuing to contribute to the C++ standards committee, for this exact reason
2
u/StackLeak Mar 29 '26
I don’t need new features, all I want is “safe to use by default” before it’s too late. It’s really important for future unless its only use would be game development.
1
u/SKRyanrr Mar 30 '26 edited Mar 30 '26
I was thinking about messing with clang source code to ban certain features on my end. I'm not a c++ dev btw
1
u/RevenantBob Mar 31 '26
I definitely feel a lot of the pain in the OP. And, like the OP, I too love C++ for some weird reason. I think it's because I own much of what is going on in the language, while other languages attempt to hide what's going on from me or take control away.
I definitely think we could do with an epoch, or some sort of method of branching away from older code bases. I can't say breaking the ABI or C compatibility is a good thing in all cases. There's a lot of useful libraries out there still written in pure C that get pulled into C++ projects.
But I suppose that's what is happening when people make new languages or offshoots. Does C++ need to change when people are willing to evolve it outside of its bubble?
1
u/st_heron Mar 31 '26
Fork and make C+2
1
u/Spyromaniac666 Apr 01 '26
While I sympathise, I think the answer is a new language. We should be rooting for projects like Rust, Go, Zig, Nim, and the like to develop, because they can eventually attain what C++ would be capable of if it… well, wasn’t an extension on C
-1
u/rlbond86 Mar 29 '26
It's not just ABI, plenty of syntax issues like null pointers, non-const by default, implicit constructor by default, and non-destructive moves. But I agree that there is a tendency not to change the core language but instead just add everything to the standard library, too.
Honestly I have given up on C++ for new projects and switched to Rust, which has the benefit of shorter development cycles and isn't hamstrung by legacy code. That shorter development cycle is crucial because the language developers can mark an API as experimental while they work out the kinks. They also have a reference compiler, which is a luxury C++ doesn't have, instead language development is separate from compiler implementation.
1
u/realvolker1 Mar 30 '26
Just use Rust, it's everything you asked for and then some.
1
u/aresi-lakidar Mar 30 '26
It's really not that bad imo
1
u/official_business Mar 30 '26
I'd agree with a lot of this. The requirement that old code never break and ABI never break means a lot of problems can't be fixed. I feel like C++ is following the safe path towards stagnation and death. Still, there's enough work to see me out to retirement.
Where I work all of the ABI and API isn't a huge deal for us. We don't use binary only library dependencies. If there's no source code we don't want it. Likewise during COVID WFH my boss forgot I existed so I spent a month updating the compiler 4 major versions and getting our codebase to compile with -Wall -Werror. I'd been wanting to do that work for ages, but my boss always shot it down.
A lot of places can't or won't make that step, and people such as myself are stuck with broken shit in the language that can't be fixed.
I had some quiet hope that Carbon would become a thing and solve these issues. I don't think it will though. Nevertheless my employer would never convert our code to Carbon anyway. I'd probably advise against it too.
I guess it depends where your tradeoffs are. For my employer ABI stability is of no value, so I'm being forced to wear the cost but gain no benefit.
1
u/DonBeham Mar 30 '26
Well in the late 90s/early 2000s this whole discussion about C++ being so bad let to the creation of Java and Microsoft later followed with C#, because Java was also kind of meh. Now we still have C# and Java AND C++, because no way you want to have a GC. In the early 2010s some people decided C and also C++ were so unbearable and created Rust. Now we have that AND C++, because no way you want to deal with this borrow checker thing and those incredibly slow compile times. About 10 years ago, Zig appeared to succeed C. And Google created Go, because async is just painful with C++ and in a couple of years we will probably see Carbon, because, well...
The result of the discussion are simply that every now and then someone creates a new language that solves some problem and creates some others.
The perfect language doesn't exist. BUT there are solutions within C++. If you don't like
copyable_functionthen create a typedef -> problem solved with just one line of code. That takes less time to write than ranting about it.-1
u/Revolutionalredstone Mar 29 '26
Unfortunately I believe this simply isn't true. (and I rail on cpp a lot)
The reality is Rust, Go etc are .garbage., people mostly still use CPP.
If a new language came along which really put CPP in its place then yeah we would change, but in reality new languages fix one thing & mess up 5 more (rust is a total wreck even if they did fix a few cpp hang overs)
The reality is it's really hard to make a great language, C did it; and CPP basically just slapped on a few bells and whistles.
These attempts to deeply rewrite the language always end up with a much worse result because; for all CPP's failures, they got a LOT right.
I hate cpp and try to replace it constantly, but I'm honest about the reality that I keep coming back to CPP because the better language does not yet actually exist..
And because any serious or high performance requiring project can just be easily lowered into C (where the only limit is your time)
-4
u/arihoenig Mar 29 '26
If you wrote that diatribe in a minute then you used AI
-1
u/ramdulara Mar 29 '26
What ABI?
-1
u/TwilCynder Mar 29 '26
At this point we should just make a new language, call it C++2, make it litterally just C++ but with the legacy breaking changes we've been wanting, and call it a day
"it's already been done plenty of times" nope, there are plenty of spiritual successors for C++ and "superior" languages that can do the same things, but right now I want specifically C++, without the bullshit
-1
u/markt- Mar 29 '26
Just nitpick here, I’d like to find out that rant took considerably long than one minute to read.
Anyways, to address, one issue that you raised that I feel deserves a dressing:
There’s a reason why breaking ABI compatibility is bad, and I respect that.
However, I do not think we should be afraid of breaking ABI if it means that implementations that are currently getting shipped are still fundamentally, broken or inefficient. The line has to be drawn somewhere, and I think that the C++ standards community would do well to recognize that
0
u/dexter2011412 Mar 30 '26
Yeah I wish for the baggage to be dropped.
I think 50+ years is long enough.
0
u/tartaruga232 MSVC user, r/cpp_modules Mar 30 '26
I agree with a lot of points, but it won't happen. This is like rewriting a very big software. It rarely succeeds. The old language/software has been battle tested ad infinitum on all levels (design, implementation in compilers and massive usage) with lots of scars on those who worked on it. The only strategy that might have a snowballs chance in hell is doing something like an alternate syntax like cpp2 does and transpile to C++. But even that project so far never really gained enough momentum beyond being a personal toy project of Herb.
0
u/SKRyanrr Mar 30 '26
Sounds exactly like this guy said
0
u/Davidbrcz Mar 30 '26
C++ peaked at C++11
0
u/Tringi github.com/tringi Mar 30 '26
You want to talk about how, not why. I think the problem is we have very little experience with that. If I could suggest possible avenue, it would be: Start with simpler parts, and see what we learn.
Let's break
typeidfirst. Decoupletypeidand<type_info>.These things that unnecessarily couple language and library together always irked me anyway. Let's have
typeidreturnconst void *pointer. Those can be compared, which is just what most portable use cases only need anyway.std::type_info::before ()can become just pointer comparison;std::type_infocan get new explicit constructor fromconst void *to expose the rest of the things that nobody uses. Hell,typeidcan returnconst char *to whatstd::type_info::name ()would give you.There, some of the cruft gone.
Then we move to deal with
std::initializer_list: Let's design a language construct replacing it. And if possible reimplementstd::initializer_listas a thin layer over that construct. If designed properly, I believe it would prune the current initialization mess.And when these are accomplished, we will have way more experience on how to proceed further.
0
u/AndyDentPerth Mar 30 '26
A lot of the above are why I moved to Swift after 25 years of C++.
0
u/MADCandy64 Mar 30 '26
And you thought portable mean potable. My gripe with it is that they gave me signed integers, supported by hardware now, but call its use UB and you get hit with a stick for even mentioning it. That's some Catholic nun bipolar disorder.
0
u/JandersOf86 Apr 01 '26
As a fledgling programmer who chose C++, after trying many other "easier" languages, your point number 4 sticks out to me (I totally gave you a fist bump for this as soon as I read it).
I love C++. I love the intentionality and complexity of it, but the fact that it is "standard" to separate out hesder files from data files is dumb. Every program I've written outside of tutorials is done only in .cpp files and I've never had issues because of it. To me, especially as a learner, being able to see both the declaration and implementation in one file is so much easier than having to swap through folder hierarchies just because it's "how it's been done".
0
u/Popular-Jury7272 Apr 02 '26
The language cannot evolve, he says. About C++. The language for which the most common complaint is they keep adding new features.
-9
u/Oxi_Ixi Mar 29 '26 edited Mar 29 '26
ABI is about C, there is nothing to do with ABI in C++
The main point in C++ from my point of view is the huge amount of defaults and implicit agreements, which make actual code often hard to argue about and requires a BS in CS to understand the standard. Which in turn gets more and more complicated with each version.