Hacker News new | ask | show | jobs
by zarzavat 7 days ago
I have no particular opinion on contracts per se, but I do think that the C++ committee is procrastinating by focusing on niche features like contracts instead of dealing with the urgent issues (namely packaging and memory safety) where C++ is losing to Rust.

The rejection was a moment for them to reevaluate their priorities but it doesn't seem that they've gotten the message.

11 comments

> dealing with the urgent issues (namely packaging and memory safety) where C++ is losing to Rust.

There's a wisdom I got throughout life in various scenarios: You can't beat anyone in their own game. Currently memory safety is Rust's game. C++'s game is different: Being a high level language with tons of features, legacy (install base), a massive and well established ecosystem, and as a result of that shared knowledge.

Hence, from my personal perspective, C++ shall be C++. Getting useful features and cross-pollination is useful, but imitating or trying to beat something in its own game is waste of time and energy.

Because Rust and C++ are built different, and Rust's features doesn't replace battle-tested code. uutils shipped with 140CVEs at some point. That'll be my poster example for a very long time.

I like this answer, plus we already have most of the memory features from a practical standpoint (C++ has had RAII since before Rust was a thing, and there are plenty of memory checkers out there). Perhaps the borrow checker is a future incoming feature but I think it would be a mistake to rush to add it.
Existing static analysers already achieve some lifetime analysis, however it is hard to go beyond what they do today without annotations.

Safe C++ proposal (based on Circle compiler) was refused, and I don't believe in profiles as they are being sold, but lets see.

At this point one could probably use LLMs to generate the annotations/memory safety proofs on the fly (and then cache them) perhaps?
In one C++ file, you can call a function in a different file and the compiler doesn't know the implementation. This allows for every file to be compiled in parallel but it blocks many forms of static analysis.

The static analyzers that can follow chains like this are extremely slow (think hours). You could certainly use an LLM but then it'd be even slower and the proof checking would still be a bottleneck.

Rust gets around this by adding annotations to functions in their interface, which happens before any of the code is compiled.

That doesn't work because it's global and borrow checking is quadratic (cubed maybe even, not sure).
I don't think you can give something like "quadratic", because obviously sometimes you cannot write those proofs. In those cases just give up after some time and have an error. Of course sometimes memory-safety counter examples can be found instead, then those can be reported.

We pretty much have the latter already. LLM agents writing tests, running it with ASAN and then creating issues for that.

I sincerely hope that they keep procrastinating on packaging forever. Packaging is not a language concern. Its an ecosystem concern. Language packacke managers that are a giant pain for the rest of the ecosystem.
Ok, but your ecosystem concern concept has a big problem. The standard "ecosystems" like Linux distributions are not built around the idea of user built/provided packages, at all.

Even ubuntu's PPAs are just an extension of the trusted repository set.

This means snap and flatpack are the only "ecosystems" left and they are clearly not designed for programmers, which is why in this vacuum every programming language has its own ecosystem.

The folks trying to work on packaging burned out, so I suspect you’ll get your wish.
I’d argue vcpkg+ninja gets the job done for 95% of use cases.
Maybe, but it’s not standardized, which is what is being asked for in this context.
Ninja is only half the story. those files are really written to be generated so you need something else.
Most packages in vcpkg use cmake. If library maintainer doesn't do anything too unusual in the CMake config then vcpkg can request ninja builds without any explicit support from the library.
I guess I was too terse. I assumed everyone uses cmake. I hate it just as much as the next guy but cmake is more or less the default.
pkgconf and meson in that case.
I would argue CMake gets the job done in 99% of cases. Use whatever you want underneath it.

If you want cargo you also need the entire ecosystem to also adopt making everything MIT/BSD and that isn’t happening and no offence but if a project is setup and using CMake features from this decade you can just use CMake FetchContent to include it and build it.

Even boost can be included this way.

Why would you want to add more dependencies that are brittle and break?

Fetchcontent is fine for small projects but my experience has been for more complex projects vcpkg integrates better with CI and deps that use e.g. meson or autotools. Plus it supports binary caching to keep (re)compile times from getting insane.
cmake is bad for verrryyyy large codebases because it doesn't have good support for distributed compilation and caching. You need buck2 and/or bazel at that point. Despite being a small minority of codebases, they have a disproportionate amount of programmers (Google monorepo is tens of thousands of people or more).

C++ can't standardize something that'd break these use cases so packaging is unlikely to ever be fixed.

The C++ commitee needs to figure out how to describe project metadata in a way that can be read by many different tools, kind of like Python did it. Being able to specify that you depend on a project is still useful even if the delivery mechanism is an OS package manager.
Languages bringing in their own packaging ecosystem via their tool always fall prey to something I call "leftpad syndrome". Go, Rust, JS, Python...

Reduce friction for adding packages to a project, and everyone imports everything in a whim.

sudo-rs was pulling in a couple of million LOCs at one point. Yeah, most of it was unused at the end of the day, but it's a massive surface for something like sudo of all things.

Cargo culting is considered harmful.

  > Languages bringing in their own packaging ecosystem via their tool always fall prey to something I call "leftpad syndrome"
I'm not aware of such problem in C#, for example.
C# has the amazing feature of forcing people to pay for the libraries they use which disincentivizes using libraries. If 50% of NPM packages cost money the ecosystem would be different too!
CPAN doesn't seem to have this problem. A few dependencies have dependencies, but it doesn't seem to be the same deal where you wanted one thing and that pulls in 7 layers of dependencies.

About half of the things I want from CPAN are available through distribution packages, and things will usually work when I use the distribution packages I can get and then install the rest from CPAN.

This is because of a couple of cultural and environmental factors.

First, CPAN is old and is labor of an older generation of programmers who were attentive to that sort of problem. Language being Perl and having the same culture in it helped a lot as well.

Moreover, CPAN is available in distributions, as you say, and no distribution maintainer wants to package and ship a dependency hell, so this is a gentle but firm deterrent as well. Lastly, Perl's standard library is comprehensive for what it does, so it doesn't need leftpad style utilities as external libraries.

On the last point: JS/TS rightly gets a lot of flak for excessive third party dependency trees, but the JS stdlib is tiny.

For a lot of stuff that could be done with the stdlib in a lot of languages you really do either need a 3rd party package in JS or write a lot of code (and tests) yourself

> [...] but the JS stdlib is tiny.

As a complete outsider to that environment: is there no way to grow the official stdlib and therefore reduce the need for external dependencies?

So languages that have their own package manager do not always fall prey to the leftpad "problem"?
Exceptions don't invalidate the rule.
The alternative is that everyone is implementing half-baked, bug-ridden "standard"-functionality for every one of their projects. Is that so much better?
I haven't seen what you are talking about. Eigen is not half baked, nor FLAME, nor RapidXML or OpenAL. Same goes for Option++, Easylogging++ (though it's recently deprecatd).

We have search engines and web registries, and they precede package managers mostly. Moreover, Linux distributions' repositories acted as a directory and everyone used these packages, which were not half-baked either.

It's not the optimal solution, but it's better than leftpad, proc-macro2 (and associated drama), and 5-link deep dependencies I have seen any programming language which has first-class packages support (incl. Go and Rust).

In my opinion, assembling a set of libraries by hand and vendoring them is way better than getting a logging library and pulling the whole world with it.

False dilemma. Another alternative is curated libraries. Plus C++ leftpad never will exist because the standard library covers a lot of functionality. Then there's Boost.
That is often better, yes. But it is also not the only alternative - after all, one of the reasons that C will never die is that it's the lingua franca of the ABI world, which kinda implies that writing shared libraries in C may be a thing.
C technically came with its own packaging system, called Unix.
I personally think that standardising std print a mistake (for example).I’ve never worked anywhere or used any project that would use it, and fmt has already left it behind functionality wise. I think the method it was standardised in is a cop out - it being a library type means that I could implement my own without the “baggage” of what print has.

If c++ added something like fstring’s or C#’s $ string then I would be able to use that functionality in my multi million line code base, and as a language feature the compiler can do more with it than it can do with a random function call.

The world doesn't run on C and C++ only so how do you suppose ecosystems work distributing packages for other languages?
We had public registries before. Also, Linux distributions provide tons of development libraries, which are also used by other packages in the distribution, which is a plus.

As a last resort, 3rd party package managers do exist. I don't use them unless I'm forced to use them, but they seem to have a shallower dependency tree, so problem is not as exaggerated as in package managers bundled with the languages themselves. Even gopls pulls in 24 more dependencies for its install. Nice.

Linux, is not the only dev OS out there, in fact, it’s probably the smallest crowd behind macOS and Windows. So how do you solve that problem now?
Losing to Rust is an interesting take. I never quite envisaged it this way.

If someone is considering writing in Rust, I doubt you will convince them that C++ is better instead. It's as if you're trying to tell someone going to the moon that Mars is the better choice.

Bizarre and ineffective analogy ... there are many reasons why either the moon or Mars might be a better choice.

The doubt about C++ over Rust isn't well founded either. For instance, someone might be considering Rust solely because of dissatisfaction with packaging or memory safety in C++.

> Bizarre and ineffective analogy ...

It's a variation of the "apples to oranges" metaphor which is just as stupid. Like, those are both fruits, so they have very similar possible uses, you absolutely can compare them! It's comparing, I don't know, toasters and umbrellas — yeah, that'd be silly, but only because the result of the comparison would be instantaneously apparent. You want toasted bread? Use a toaster. Protection from rain? An umbrella is obviously superior. Painting a roof? Both are equally useless.

So, Rust vs. C++? You want language features, you want tooling, you want the library ecosystem, you want the resulting programs' performance. All of those are things that the languages can, and should, be meaningfully compared with each other on.

Why should C++ "win" over Rust?

C++ already has the tools needed for memory safety, but it will never like Rust without serious compromises. Remember, C++ is C with extra features (except for a few minor details), C is not memory safe and will never be, so, for C++ to become memory safe, it has to depart from C, which to me is completely missing the point of C++. To me, the point of C++ is: "I want to write C, but I also want feature X", where is can be templates, classes, smart pointers, namespaces, etc... I don't have to use them all at once. For instance, if the only thing that interests me are templates, I just write my C code with raw pointers and all that, have my templates and compile it with a C++ compiler.

As for packages, there are already packages managers for C++, such as Conan. Unlike Rust, C++ is just a language, Rust is a trademarked brand, with a foundation that manages a whole ecosystem with the language itself but also a packet manager, build system, repository, community, etc... Different scope. For standardizing packaging, one would need a different committee, which may or may not align with the C++ revisions.

As for the "niche features", it is again the idea that C++ is C with extra features. Some people need contracts, give them contracts, others can simply ignore them. It is just another tool in the toolbox. Unlike Rust-like memory safety, it won't affect those who don't need it.

If you want Rust, use Rust, don't make C++ be Rust. Or maybe try some of the alternatives like Carbon.

> C++ is C with extra features (except for a few minor details), C is not memory safe and will never be, so, for C++ to become memory safe, it has to depart from C

Which it did long ago.

> To me, the point of C++ is: "I want to write C, but I also want feature X"

You are part of a small minority.

It's worth noting that C and C++ have already diverged significantly. The two have different undefined behavior, different aliasing and punning semantics, etc.

(The two most famous examples of this are type punning, which is well-defined in C but not in C++, and infinite loops without side effects, which were UB in C++ until this year because of C++'s stricter forward progress guarantee.)

    C is not memory safe and will never be
On the contrary, C is far more easily made memory safe than C++, because it's a much simpler language with almost entirely explicit control flow. You have fil-c, CMBC, TIS that all work today, not to mention the profusion of annotation-based tools that have existed for years. Galois is working on C2Rust and other tools, though they're not fully safe/general yet.

Your options for C++ essentially amount to sanitizers, less-accurate static analysis work, and paying experts like TIS for manual verification. C++ is also choosing to actively make the problem worse when it deliberately refrains from adopting C's verifiability improvements, like prohibiting time-traveling UB. It's not like this is solely a problem of legacy standards either. std::span could have been safe (as gsl::span is), but the decision was made to deliberately sacrifice safety for other considerations.

I agree with this. And C could certainly be much further, if we only had a fraction of the resources the industry spend on C++ or Rust.
It would not solve anything, when we still fail at having C developers to adopt simple tools like lint (1979).
A few years ago a C friend of mine had just discovered Splint and talked like it was state of the art.
Yeah, exactly my point.

Look at clang tidy, it is right there in the compiler, and yet.

Again, this would be missing the point of C.

While the philosophy of C++ is "C with extra features", and it certainly delivers on extra features, C is all about simplicity and compatibility.

You want to touch C as little as possible. There are who knows how many thousands of C compilers for obscure platforms and decades old legacy code that all depend on C being stable. The industry mostly leave C alone not because they don't have the resources, but because the world runs on C and they certainly don't want to break things that work!

If what you want is a simple, explicit language that is well suited for system and embedded programming while being more modern than C, there is Zig.

I like to say that Zig is to C what Rust is to C++.

I agree that C should be stable, but my point was also not that it should change a lot. As one can see with Fil-C or with model checkers proving memory safety, a lot can be done even without changing it. Although Zig is nice, I really prefer C.
> C is all about simplicity and compatibility.

Not paying that much attention at ISO C since 1989, right?

I am fairly certain that even today, C89 compilers (or compilers for later C standards in the C89 mode, if they have it) can still compile the C89 programs just fine.

The desire to compile C89 programs with e.g. a C26 compiler (that is, a compiler for a similar, but different language), and yet still get the program with exactly the same observable behaviour, always struck me as strange. If you want to keep using your old compiler, you can use it. If you want to port your program to a newer version — well, you'll have to port it. They way to actually make this porting easier would be to have required diagnostics in the compilers but that seems to be counter-cultural to the C community in large.

Of course, the proper way to ensure backward compatibility would be to have every translation unit start with something like "#pragma std(c99)" and then mandate that the semantics of the corresponding language standard shall apply during translation of this translation unit, and that the conforming implementation must support all the previous language standards (in conformant way)... but again, that'd never fly with the C community, neither with the implementers nor the programmers — instead we have a vague definition of what "C code" is (and what is its semantics), which is time-dependent, but efforts are made to ensure that things that used to be C code, and their semantics, still count as C code and their semantics don't noticeably change over time (well, maybe).

Imagine a fraction of the resources the industry spend on C was invested into Pascal
> You have fil-c, CMBC, TIS

How many of those are at runtime vs compile time?

> On the contrary, C is far more easily made memory safe than C++

Except for all the ways in which it isn't, which are more applicable to the average codebase than any of those tools.

> For standardizing packaging, one would need a different committee, which may or may not align with the C++ revisions.

I don't think you need a separate committee. There were efforts to create a standardized packaging system through the committee, but the author decided to pursue a different path outside of the committee after it was clear that the committee's priorities were elsewhere.

If I understand contracts right, as in, that they're a basic form of dependent typing, I think that offers a form of safety in its own right.

As a fan of functional programming, I love this as a language feature. I also appreciate that it's profoundly opt-in, and I agree that package management and memory safety are more pressing.

I'm curious, as a C++ outsider: what memory safety features are currently being discussed that look most promising? How many would retroactively apply to existing code bases if compiled against an appropriately recent `--std` setting?

> If I understand contracts right, as in, that they're a basic form of dependent typing,

No, C++ contracts have nothing to do with the type system. It is purely predicate calculus using Hoare logic where subsets of state space are filtered from a larger program state space. The program is basically "steered" through the global state space using pre/post conditions.

Note however that theoretically (i.e. following from Curry-Howard correspondence) contracts can be thought of as dynamic counterparts to dependent types. But that is in a functional language with typing using constructive logic and not in an imperative language.

I’m not a C++ programmer but I like the idea of contracts. I’d be happy to have them in Java.

However, I think it’s insane to allow them to modify values. I get it probably really hard to prevent that in C++, but man is that going to be insanely hard to reason about.

I thought contracts were just sugar for pre- and post-conditions.
I don't get how this is 'urgent'. Frankly, as a C++ dev of ~7 years, it's very rare that memory safety is the part causing me issues or slowing me down.
I think the Common Package Specification goes a long way to fix packaging with C++ after trying it
Agreed, it is still baby steps, though.

CMake 4.5 is the first stable release with support for it, and it still needs to widespread.

They need a big ABI or possibly even API break to clean up. It's common enough to specify standards on the compiler command line now, and i.e. Microsoft's runtimes have handled multi-versioning for a long time.
What exactly does an ABI break give them? There are some minor inefficiencies they would need to break ABI for (std::unordered_map, std::regex, std::unique_ptr not being passed in a register) but realistically, nobody is in a position where they would have chosen C++ if only it wasn't for those tiny inefficiencies. Rust is eating its lunch for completely different reasons.
Rust still needs to be fully bootstrap, as means to remove its toolchain dependency on C++, and yes I am aware of Cranelift.
"Needs" seems like a rather strong word to me. What essential thing is lost by not fulfilling that requirement?
I think OP is correct here.

The way I see it languages are industrial ecosystems.

There are several good reasons why a language should have "it's own" compiler chain.

While C++ is not going to disappear, piggybacking on C++ infrastructure means that Rust is not really standing on it's own feet institutionally or technologically.

These two have lots of second order effects as I see it. But the topic is too complex to fit to a brief comment :)

That's why I asked OP for clarification. To me, if you "need" something that something is a hard requirement to achieve some goal, so what you "need" will depend on your specific goal(s). Rust obviously doesn't need to fully bootstrap itself since... well, it exists, so presumably OP had some other endpoint in mind.

To me, the things you describe might be nice to have, and I certainly could understand a language choosing a set of goals that makes those an actual requirement, but I have yet to hear of Rust devs taking that particular stance.

"but I have yet to hear of Rust devs taking that particular stance."

The two things require proper industrial backing.

So I would not frame it as "Rust devs don't see the need for this" but "the Rust devs have not yet convinced enough industrial backers to support a real ecosystem around the language".

The fact Rust does not have these is not an omission in itself. But it makes it look less serious.

> So I would not frame it as "Rust devs don't see the need for this" but "the Rust devs have not yet convinced enough industrial backers to support a real ecosystem around the language".

Those don't seem mutually exclusive to me. If the Rust devs don't think they need such things then I wouldn't be surprised if they don't bother trying to get industrial support for them as well. Basically everything is a tradeoff, after all, those things included.

It's also unclear to me what novel things are missing from Rust's current ecosystem that a "real ecosystem" enabled by a Rust backend would have. Cranelift exists, after all, and I'm not aware of such an explosion of features/projects to call Rust-with-Cranelift a "real" ecosystem while the ecosystem for Rust-with-LLVM isn't "real"

If anything, I'm not sure the choice of language for the compiler makes that much of a difference for a language ecosystem, if any at all, since the ecosystem is generally concerned with... well, the language, not compiler internals, much less the backend specifically. For example, I don't think the C/Fortran ecosystems particularly care that their main compilers are now written in C++. Similarly, I don't think the TypeScript ecosystem particularly cares that its main compiler is now written in Go instead of TypeScript. All they care about is that there is a compiler.

A similar line of argument applies for "less serious", I suppose, though that is a bit more subjective.

I know this might sound like a hot take considering that cranelift is not very fast yet, but Rust is actively being held back by some core assumptions behind LLVM, which was originally built for a world full of mutable aliasing, which is no longer tenable in 2026 now that an AI could build a working compiler that takes full advantage of the mutable-xor-shared model.
Do you mind elaborating more on the "core assumptions" and/or the optimizations they preclude? Don't think I've heard anything yet about things LLVM can't do as opposed to things it can't do yet.
The ability to trust the compiler.
I'm not particularly convinced the presence of C++ in the toolchain is a good deciding factor for whether you can trust the compiler (well, depending on what exactly you mean by "trust", I suppose). If anything, I think people already generally consider the Rust (and C and C++ and Fortran and etc.) compilers built on said backends trustworthy so it's not clear that anything is missing in the first place.
That's actually the opposite: to avoid trusting trust attacks you need to remove Rust from the bootstrap chain, not C++.
Why do you trust the C compiler.
trust in what meaningful way toward the task of code compilation?
Given how bloa- err, large both c++ and rust are I don't see how anyone could ever trust a compiler for either language in the same way you can a minimal c (or better yet r5rs) compiler.
Rust Evangelism Strike Force. telling everyone that Rust is going to "replace" C++, when it actually can't exist without a compiler framework written in C++.
Oh, I thought you had something more serious in mind. I wouldn't really call that kind of claim "essential", particularly given the rather wide range of claims made by people with a rather wide variety of expertise that are attributed to the RESF.
"C++ is losing to Rust."

This is a really weird way of stating this.

It's like saying "hammer is losing to a screw driver". These are tools with different requirements spaces.

But in general agree it feels more academic than industrial.

Plus so many, many billions of lines of C++ code out there in companies.
Contracts are part of the memory safety story in c++
And that’s exactly why they’re so controversial. As adopted by the committee they do not do anything to provide memory safety.

The pushback from the final rejection got the committee to add the bare minimum that could help C++’s safety story.

To expand on this, my understanding is: the thing that held back approval (from the national bodies, not the committee itself) was that build configurations could turn off contract checks, which run at runtime, and still be standards-compliant. They wanted library authors to be able to write checks that will actually run, regardless of the build configuration of the person compiling!

So the “fix” was to let the author mark individual contracts as always enforced at runtime, with pre<enforced>. That, in turn, means a library’s key safety checks (bounds, null, etc.) can’t be silently dropped in a “loose” build configuration, which pushes things down a safer path.

Clunky IMO, but rather reasonable as a response to Rust!

It brings things closer to a world where: if you use these “safe” libraries, your program will stop rather than run unsafely, no matter how it was built.

While I don't doubt this makes C++ safer, it really has nothing to do with memory safety which is usually understood as a language-level guarantee, either through the type system (as in Rust), or through execution in a managed environment.
I think some increase in memory-safe outputs is a part of the 'memory safety story' of C++ regardless of whether this comes from type-level changes or improved constructs for memory safety.

Perhaps, a good way to describe the difference here is to clarify that contracts do not innately make C++ as a language more memory safe, but have plenty to do with the memory safety of C++ applications.

Agreed that it’s not memory safety in the language-guarantee sense. But it lets a library make a spatial-safety guarantee that holds regardless of how it’s compiled.

If I call safe_library::some_low_level_op(some_offset), the library can guarantee a bad offset terminates the program before any out-of-bounds access, and no build flag on my end can drop that check. That’s the same “safe API over unsafe internals, enforced at runtime” pattern Rust’s own standard library relies on for bounds.

What C++ still can’t do is stop me from bypassing that API with a raw pointer, or help at all with lifetimes. But it's useful in practice, not just in theory.

There was a recent discussion about the C++ contracts, and one of the top comments [0][1] in it was that, well, there are already assertion libraries (especially after C++20's concepts) that already do all of that, and better.

[0] https://news.ycombinator.com/item?id=50361334

[1] https://news.ycombinator.com/item?id=50361455

And I really do not like the idea that some third-party library that happened to use decides that I can't turn off a expensive check that would never be triggered in the real world.

Now if the contract was instead, it must be proved at compile time I'd be for that. I don't know if theorem checkers are good enough to pull that off.

I don't have a problem with this, library writers are free to design any way they want. If this requires expensive checks, that's a library design choice, and users are free to choose a different library if that's not what they want.
And what if those "expensive" checks are done with an if () {} instead?
How can you know it will never be triggered in the real world? Isn’t that the entire point of this? To catch those bugs and prevent things from going off the rails and continuing on?

If you know it will never happen, what’s the point of the feature?

You're aware that third-party library developers have always been able to put all sorts of expensive runtime checks in their code which can't be turned off, right?
But why do you need a new language feature for that?

If statements can do guaranteed enforcement of bounds och null checks.

> The pushback from the final rejection got the committee to add the bare minimum that could help C++’s safety story.

What they added is no different in practice to what contracts already were before. If a compiler adds `-fno-contracts` then they will not be enforced, which was already the case.

But hey, if it helps C++ make it past the ISO process then it will have been a value-added change even though it's not actually any different.

> But hey, if it helps C++ make it past the ISO process then it will have been a value-added change even though it's not actually any different.

If the feature is irredeemably broken as opponents claim to be, what does a glorified rehearsal session changed?

I think this outcome is the worst outcome possible. Contracts proponents seem to have doubled down and hell bent on playing a game of political chicken. It's plausible the same proposal will be rejected again on the same grounds, with the same string of personal attacks that followed it.

> If the feature is irredeemably broken as opponents claim to be, what does a glorified rehearsal session changed?

That’s just it, it’s not. It’s not less broken than C++ already is, but that version of C++ already is here and it’s called Rust.

> Contracts proponents seem to have doubled down and hell bent on playing a game of political chicken.

Looks opposite from my end. I don’t know what about this has made it B.S.’s bête noire, but the politicking has all happened outside of and after the technical discussions resolved.

I don’t even plan to use contracts and I’m pretty disgusted by the efforts by anti-contracts people who would prefer to blow up C++ than to see a vote go opposite their personal preference.

> It's plausible the same proposal will be rejected again on the same grounds

I almost hope it does, and we can get ISO out of C++ entirely and just leave it with a WHATWG-style governance instead run by gcc/clang/MSVC.

> That’s just it, it’s not. It’s not less broken than C++ already is,

Your comment makes no sense.

> (...) but the politicking has all happened outside of and after the technical discussions resolved.

Evidently that's false. The contracts proponents have routinely ignored any feedback about technical problems plaguing the proposal. There is a string of papers documenting extensively the flaws in the proposal, one of them published somewhat recently that remains ignored, and the fact that contracts proponents have been purposely ignoring feedback to force push a broken feature says volumes about the ordeal.

And then there's the smear campaign and all personal attacks following the proposal rejection. Have you not noticed how contracts proponents avoided any discussion on the technical problems plaguing the discussion and instead focused on a smear campaign based exclusively on personal attacks directed at a single person?

> I almost hope it does, and we can get ISO out of C++ entirely and just leave it with a WHATWG-style governance instead run by gcc/clang/MSVC.

False dilemma. The choice is not between this nonsense we are seeing coming out of contracts and a fabricated scenario you made up. The choice is between this nonsense we see with contracts and simply removing contracts from C++26 so that either their problems are worked out or removed altogether. This is quite simple.

> Contracts are part of the memory safety story in c++

Contracts are an optional debugging tool. They are literally designed to assert pre and post conditions. They are no better than the assert macro in asserting memory safety.

Contracts have nothing to do with memory safety.
Contracts have plenty to do with memory safety; the notion of 'hardened implementations' and bound-checked vector access ( 2 enormously popular features) rely on the contracts model.
Contracts as originally designed by the committee were explicitly not meant to enforce memory safety in that way. You were not supposed to be able to rely on the existence of any particular contract check at runtime. This recent change was something that the committee had rejected earlier, and probably begrudgingly accepted this time around as a compromise to try to ensure the NB vote passes

The two features you list don't have to depend on contracts, and in fact didn't do so at first. The dependency was only added later, and there were efforts to undo such a change right to the end.

Furthermore, IIRC hardening only relies on the contracts system to report precondition violations. The actual checks are intentionally not contract assertions and are intentionally not controlled via the same system as other contract assertions (i.e., hardened checks remain even if you use "ignore" as your contract evaluation semantic).

The reason for this is that C++ has, by design, avoided the use of runtime checks. But I think this is ill advised from now on, as we need to enforce safety behaviors beyond what the type system can do.
Assertions were always an option. Unless I'm missing some new development, contracts are just a new way to spell assertions. That's good, but it doesn't move the needle at all in terms of memory safety.
making memory safe patterns easier to implement makes for more memory safety:)
interesting. how would I use contracts to avoid returning (or passing to a function that can persist the value) a span or string_view that refers to local or temporary value? or a lambda that captures such value by reference?
How?
A good way to think about contracts and related features as they relate to memory safety is from the compilers perspective; pretty much any feature that gives the compiler additional information about a users intent for a scope allows the compiler to have to infer less, and thus have more ability to provide 'safety' guarantees.

The most trivial example of this is a check that a caller has provided non-null inputs ( hence allowing 'safe' unchecked access in most cases)

> A good way to think about contracts and related features as they relate to memory safety is from the compilers perspective; pretty much any feature that gives the compiler additional information about a users intent for a scope allows the compiler to have to infer less, and thus have more ability to provide 'safety' guarantees.

Except this isn't true, and it's at best an unfounded belief that relies on hand waving and wishful thinking to connect how an optional debugging tool that affects memory allocation and is able to throw exceptions will save anyone from things such as use-after-free.

If you're going to rewrite a bunch of C++ to add contracts to assert that your pointer arguments are non-null ... you could, I don't know, just use references instead, the exact construct we have had for decades to express this. If you're cargo-culting the GSG so much you're unwilling to use references appropriately I seriously doubt you are also going to replace whatever existing "pointer argument x is non-null" checks you use with a brand-new contracts mechanism.
There are many common places where this pointer case comes up and using references is simply not an option ( i.e plugin/FFI boundaries, dlsym callbacks, externed C). You will have a very bad time doing any systems programming, for example, if you live by the dogma of shaking your fist at raw pointers and saying use refs instead!

Perhaps for a more familiar case where contracts allow greater memory safety: constexpr T& operator[](size_t i) const pre(i < size()); constexpr T& front() const pre(!empty());

or even more commonly: void register_handler(std::unique_ptr<Handler> h) pre(h != nullptr);

Yes, I am distinctly over-simplifying things. There certainly are cases where pointers are appropriate, but I suspect anyone doing this responsibly already has the necessary non-null checks idiomatic to their codebase, and I am very dubious that anyone doing so irresponsibly is going to jump straight to contracts. I only mention the GSG because in the codebases I regularly deal with my experience is that the overwhelming majority of non-nullable pointer arguments appear in cases that adherence to the GSG has created, rather than cases where it is actually necessary for the API.
References hide important semantic information:

    int x = 1;
    foo(x);  
    // What values has x?
In C the answer is obvious, in C++ due to the existence of references and the poor way they are designed, it is not anymore.
What's wrong with checking the signature of foo to see what it does?
Except for any codebase of meaningful complexity you end up with functions that mix value and pointer variables, and whatever "obvious" signal you get out of the simple cases disappears into the noise. At the end of the day there is no replacement for understanding the signature and behavior of the function that is being called.

Considering that every other "C family" language community gets by just fine with call sites that look like using references, I think calling this element of references "poorly designed" is quite a stretch.

References are not a magical spell that guarantees a pointer is non-null. While they help avoid this, because of the way C++ behaves it may result in a null object as well, so a run-time check is still needed.
What references avoid is the unnecessary addition of nullability, not nullability at the source. They also convey that non-nullability to the compiler and user of your API directly, rather than hoping that point-of-use null checks convey the same thing. You still need null checks if you have nullable items, but better to localize those checks specifically where needed than scatter them across your codebase.

Amusingly, the Chromium folks found this out firsthand when working on Rust bindings - all of the unnecessary pointer arguments due to the GSG complicated the process.

> While they help avoid this, because of the way C++ behaves it may result in a null object as well, so a run-time check is still needed.

I think the difference is that with references you can only perform such a check before you create the reference. Pretty sure optimizers can and will elide checks for null references.