today at 8:41 AM
This contracts design is good, opposed to Gudstedt's variant with the semicolon.
Because here it is trivial to make them backwards compatible, by just using a PRE() and POST() macro which are empty pre-C++26.
The contracts_assert is either static or runtime, which the compiler can decide. Better than explicit static/asserts, which are either unnecessary or costly.
today at 8:37 AM
IMHO the current contracts are a half-baked feature that I suspect will immediately end up in most coding styles as "do not use contracts".
I understand the concept but having a feature that's not consistent among compilers, targets, ... all while doing absolutely nothing to solve the _real_ problems with C++. Like that the build model is still the obsolete TU model of C, while adding multiple compile-time features that inevitably end up causing build times to skyrocket considerably. Or that modules are still DOA after 6 years. Or that the syntax is full of bullshit anti-features that could be at least fixed by having a proper build model (like Rust) and editions (like Rust).
Having yet another feature that only works sometimes with quirky semantics is dumb and I understand why many people feel like it should be shelved to prioritise the features people _really_ care about, like meta
today at 8:43 AM
What a mess. Can anyone give me a bull-case for why you would ever pick C++ for a new project?
today at 8:33 AM
C++ is probably the largest, most complex programming language to ever exist. I, as a former C++ compiler developer, find it hard to keep up with the language changes. What chance does an average user have?
today at 8:19 AM
I can only describe current C++ as a Frankenstein. Trying to introduce modern features while having to keep compatibility is just really hard and probably not "the right way".
today at 8:39 AM
Frankenstein was the scientist. It was his "monster" that was a patchwork of all kinds of things.
today at 8:25 AM
That's why the world looks more favorably at Rust than C++ now.
today at 8:35 AM
What does "DIS" mean?
today at 8:41 AM
“Draft International Standard”, but that doesn’t mean much unless you read how the ISO process works[1]. (It’s like writing “Advanced Encryption Standard” instead of “AES”—unhelpful beyond giving the broadest category to which the thing belongs, “a document” resp. “a cipher”.)
[1] https://www.iso.org/stages-and-resources-for-standards-devel...
today at 8:41 AM
[delayed]
today at 8:42 AM
DIS is Draft International Standard, the near-final draft that ISO national bodies vote on before it becomes an official standard.
Also: LEWG is the Library Evolution Working Group.
today at 8:28 AM
The simplified TLDR is that ISO for the very first time did not approve a proposed C++ standard.
9 out of 22 countries voted "no", six would have been enough. These were Denmark, Finland, Iran, Italy, Japan, Luxembourg, Romania, Spain, and Sweden. In a addition and independently only 12 of the 20 participating members approved when 14 were needed.
The dispute is most likely because of a single feature called "contracts".
Very simplified these are conditions placed in a function's signature that are supposed to be checked at runtime.
today at 8:32 AM
Old king is still fighting but rust is just more properly for agent powered missions
today at 8:25 AM
C++ has lost touch with reality a few years ago. Modules, a feature 6 years old still only have partial support [1] and are nowhere to be seen in practical use. Good luck finding g a C++ library using modules.
This may be similar to Java vs Kotlin race, where Kotlin added improvements, while Java was still stuck in 1.8. The answer was to add as many features to the language as possible. Looks a bit like C++ is starting to do the same.
[1] https://en.cppreference.com/cpp/compiler_support
today at 8:28 AM
> The answer was to add as many features to the language as possible.
Because Java is losing market to languages with many features. Which is good. Given history of Java under Oracle supervision, and the availability of Rust, Go and C#, I won't ever touch any JRE-based language.
today at 8:35 AM
The C++ committee is pointless, and this is coming from a C++ expert.
Most of the things the committee has been "working on" are realistically _side projects_ today with AI. I've made countless additions to my clang fork the most notable being a source compatible borrow checker, ie you turn it on and it tells you where you effed up. Zero source changes. Equally as correct as Rust. For any sane C++ program. The committee still isn't capable of implementing this btw.