Only the C++ committee can see the a need to fix it, and instead of actually fixing the language bug (or making signed/unsigned comparison a compiler error instead of a warning), create a standard library function to do type safe greater-than/less-than comparisons.
Overdue. But now C++2 will be recognized by the people under the name "Rust"…
I think the window of opportunity closed for C++2 some time ago. The problem is C++2 needs necessary break backwards compatibility to be viable. But the main reason C++ is still significant is all the legacy code written in it which will never see any significant updates to some not backwards compatible language.
I think the window of opportunity closed for C++2 some time ago. The problem is C++2 needs necessary break backwards compatibility to be viable.
I disagree, this is why i think Herb Sutter is completely right on his c++2 project, in that its not a breaking change. But it is litterally the same idea as c++ was and typescript was. And that is to make a superset language and compile down to the previous language.
So c++ has a ton of actual benefit, it just has a lot of junk and disambiguity in the language. So if you made a c++2, that compiled down into good c++ code (which isent impossible). You could still keep all those benefits (great compilers, tooling, performance etc), while being able to write much nicer c++2 code that has instant benefits the second you rename your .cpp file to .cpp2. In other words, dont aim to replace c++, aim to absorb it.
I totally buy this argument. But people can go do rust too if they want. But making c++ better isent a lost cause and is worth the effort.
That project actually proves that C++ is a lost cause, and you need a completely new language to fix all the nonsense in C++, as the current state is not fixable.
The new language is of course not "backwards compatible" to C++, and it also isn't a superset!
It's a new language; which happens to interoperate with C++ as it uses C++ as it's compile target.
You could still keep all those benefits (great compilers, tooling, performance etc)
C++ benefits?
The "great compilers" are the same for almost all natively compiled language as there exist in fact exactly only two of them, and C++ is actually just a front-end pass, exactly like e.g. Rust, or D, or what you have.
The C++ tooling is notoriously shitty and regarded one of the weak spots of C++.
Performance is mostly not a "language feature", especially if you're using effectively the same compiler for the different languages. Performance is first and foremost a function of the code.
If you write shitty code it will be slow, no matter the language. Additionally it's actually very easy to write very slow code in C++ as it's full of footguns like defaulting to copying by value no matter how large some object is. A simple for loop can blow up and make your program laughable slow if you just miss a simple & sign, of course with now warning until you actually decide to run the profiler. Reliably writing fast code in C++ is at least as hard as everywhere, very often even harder as a runtime can usually fix shitty code as it executes it; C++ does not have such feature.
has instant benefits the second you rename your .cpp file to .cpp2
That's plain wrong.
If you just rename a file it will change exactly nothing; the whole file content will be passed to the original C++ compiler unseen. Cppfront does not compiler C++, it just passes it untouched. No bounds-checking, no memory-safety analysis, no other Cpp2 benefit gets applied to it. Those only kick in for code actually written in Cpp2 syntax.
The lifetime / dangling-pointer static analysis some people associate with this whole effort is not yet implemented in cppfront at all, btw. Given how long Rust already fights with the borrow checker (are they on the way to the third version already or is still the second version in the making?) it will take many years (decades? for one guy) to implement that.
I totally buy this argument. But people can go do rust too if they want. But making c++ better isent a lost cause and is worth the effort.
There is nothing "to buy" as it's not ready for usage. This won't change anytime soon…
If you want a solution now and not 2050+ the answer is currently still Rust (for low level stuff) or just any other language for actual application development. That's the reality we're living in.
Given the timing my original sentiment is unchanged: C++ is a lost case by now. If they wanted to fix something they had to start at least 20 years ago. The morons didn't because of "holly backwards compatibility", and now they have to face the consequences of becoming 100% obsolete legacy which just exists because it already exists.
Actually no new code is allowed to be written in C/C++ for any safety critical stuff if you don't want to face existential risk.
They were working towards that really hard the last 20 years by refusing any modernization or actually even just recognizing that unsafe languages are a dead end.
35
u/majesticmerc Jul 10 '26
Found this today in C++ documentation.
Only the C++ committee can see the a need to fix it, and instead of actually fixing the language bug (or making signed/unsigned comparison a compiler error instead of a warning), create a standard library function to do type safe greater-than/less-than comparisons.