Comment by wahern

24 days ago

Correct me if I'm wrong, because I don't follow C++ very closely, but based on previous discussions on HN, the opposition paper obliquely referenced in the blog post was presumably Bjarne Stroustrup's, who IIRC had already said he would work behind the scenes to make sure the final pro forma vote to standardize C++26 would fail.

Bjarne Stroustrup has been pushing Profiles, which would allow C++ code (or the majority of it) to become type-safe and memory safe.

Contracts are useful, but don't guaranteed anything if type safety & memory safety can be bypassed.

I think the ISO panel made the right call. The real world consider memory safety & execution integrity to be critical issues, and C++ no longer to be viable. Without some major improvements -- I would consider this view to be correct.

  • > Profiles, which would allow C++ code (or the majority of it) to become type-safe and memory safe.

    Certainly safer, but not memory safe. Operations as simple as multiplying signed integers or popping an empty vec can be undefined behavior which is not memory safe.

    • For most domains, it is fine. Why should my valued checked code pay the price for checking every arithmetic operation for overflow. Why should my correctly implemented algorithm waste CPU checking something I know is valid? And worst of all, what happens when a logic error is encountered, we run untested code path? I hate code that is conditionally defensive (eg. if (ptr) ptr->critical(); ). I should never be in that situation, a silent ignore corrupts internal state, and never tested the fail path. Ptr may even refer to garbage. Its a stupid defebsive check in 90% of code bases. std::optional<Ptr> at least clarifies intent.

      7 replies →

  • > Profiles

    Contrary to Contracts, which at least managed to get consensus in WG21, I very much doubt that Profiles will get consensus.

> Correct me if I'm wrong, because I don't follow C++ very closely, but based on previous discussions on HN, the opposition paper obliquely referenced in the blog post was presumably Bjarne Stroustrup's (...)

I've noticed that Bjarne Stroustrup is being subjected to a smear campaign, when things are far simpler and far less conspiratorial than they are making out to be.

There are indeed papers demonstrating that not only is the current proposal for contracts broken but it also fails to adhere to core C++ principles. They have been published since at least 2017. Contracts aren't new, nor the problems they introduced. They've been routinely removed from C++ standards, and so far the proposal wasn't fixed.

So ask yourself this: why was a notoriously broken feature forced into the proposal when it was clear it wasn't going to pass?

From an outsider's point of view, I see this from a different perspective. Contracts proponents tried to use bureaucratic tricks and threats of abnormal processes to force a broken feature they knew for years that wasn't supported or passing the smell test. And now that they saw their efforts thwarted , the complain that their plan failed and they have opposition?

I mean, there is even a paper dating back to 2025 called "contracts concerns" and from 2026 called "contracts fundamental flaws". The C++ standard is a consensus-driven process. Does this look like consensus? Clearly no.

So we have a group of people who ignored the calls that they were pushing a broken feature, but tried to railroad the process anyway and ignore any concern or warning. Then, when they tried to force their way through the process, their bluff was called and their threats failed. And now they are lashing back.

  • I would really love to know: who are the people pushing the current version of contracts, who do they work for, and why does the current version of contracts meet their needs if it's so flawed?

    • > I would really love to know: who are the people pushing the current version of contracts, who do they work for, and why does the current version of contracts meet their needs if it's so flawed?

      It seems the lead author and champion is a guy from Bloomberg, of all places.

      https://isocpp.org/files/papers/P2900R6.pdf

      As the story goes, these guys pushing contracts systematically pushed a broken proposal by dismissing criticism with bureaucratic chicanery such as purposely ignoring feedback and criticism by claiming that if other people voted in favor of their proposal then they shouldn't need to bother with feedback from those who opposed.

      I mean, look at the reaction. It's not technical. It's not principled. It's bureaucratic and grounded on petty politics, and dismissing yet again a failure to gather consensus as personal attacks and a political issue.

      1 reply →

  • > I mean, there is even a paper dating back to 2025 called "contracts concerns" and from 2026 called "contracts fundamental flaws".

    Two papers that both have the same authors, one of whom is Bjarne Stroustrup.

    Why are you convinced the narrative is that contracts are actually broken and unfixable instead of a few influential people just really hate it for reasons they have been unable to convince anyone else are valid?

    Have you read the "contracts fundamental flaws" paper? Looking at it now, it's hard to take it seriously. The biggest complaint seems to be that the marketing of contracts is wrong. Literally: "We would welcome a contracts design that is simple, and “marketed” as just a debug aid, rather than a safety feature."

    It really does look like Bjarne is convinced that profiles are the future for C++, and contracts makes it less appealing to get there. And that's something that reasonable minds can just disagree about without it being a conspiracy of some kind. WG21 doesn't seem to believe that profiles are an anytime-soon-if-ever feature, and contracts provide immediate benefit that justifies any future complications with profiles.

    • Having just read Stroustrup's paper (https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p43...), I'm inclined to agree with it.

      Stroustrup's objection of subversion of, and politicization of the "consensus" process seems pretty darned reasonable to me.

      And having two major compiler implementers (Clang and Microsoft) among those opposed to the proposal seems like a very poor sort of consensus to me.

      The decision to defer how contracts on virtual methods work until C++29 strikes me as particularly horrifying, and renders the feature completely unusable precisely at the point where it most needed (PIMPL classes where public methods are pure virtual, with implementation provided in a private derived class).

      And reminds me of c++20 coroutines, for which we are still awaiting a usable implementation. I made the mistake of actually writing a wrapper library for c++ coroutines. A great feature, but only heroically usable in its c++20 incarnation. (I actually did use it in project, but was left wondering why anyone would actually release THAT feature without a supporting class library). Implementation details were shocking, and awful, and insufficiently specified. And I would be completely amazed if my wrapper library continues to work with C++26.

      God willing, C++26 will provide an implementation that allows us to sanely use coroutines in message pumps and thread pools soon (such a great feature!), if the standards committee, God Willing, takes the right and good and sensible path of removing contracts from C++26 so that we can get the structured concurrency library.

      All in all, I can't help wondering whether the C++ standard doesn't need "Experimental Features" like Java has. It's certainly interesting to see how The Who Must Not Be Named (Oracle) uses experimental features, some of which have existed in experimental status across four or five Java releases. C++20 coroutines and contracts would have been perfect candidates for "experimental C++ features", that can be tested and hardened and have breaking ABI changes made as necessary and appropriate.

      > welcome a contracts design that is simple, and “marketed” as just a debug aid

      The operative word would be "simple". It's hard to imagine that the feature would require 56 (!!) pages of specifications if the constness rule were omitted. Who the heck ordered that!!??

      1 reply →

Yes that's right, and from following some threads on reddit about this, he used some really dirty tactics to get it to fail, like scheduling certain snap elections to happen with very short notice at times of the day when people who would oppose his point of view would likely be asleep.

  • Reddit is a cesspool, I wouldn't put faith in anything you read there.

    There were no "dirty tricks". The C++ standards committee works by a vaguely defined "consensus", which requires more than "the majority rules". Contracts got added to the C++26 draft. Then there was consensus that Contracts needed to be fixed, but they could never get consensus on any particular fix. So they cruised along relatively unchanged.

    In the end, the only way to NOT accept a marginal Contracts feature was to vote down the full language spec. Now they'll regroup and decide how to proceed.

  • If this was true I'd ask myself why he was this motivated to block it. He's a smart man and not a corpo rat to do dirty things just because.

  • > like scheduling certain snap elections to happen with very short notice at times of the day when people who would oppose his point of view would likely be asleep.

    ...He has the power to do this? And for which elections, exactly? The main go/no-go votes are the ones at the big meetings and I'd imagine there's not a lot of room for scheduling shenanigans there.

  • > ...at times of the day when people who would oppose his point of view would likely be asleep.

    Stroustrup is 75 years old. This is not only hard to believe because of his age, but also because it requires that people who oppose his views somehow have distinct sleeping patterns from ones who agree with his views. Weird, man.

    • > that people who oppose his views somehow have distinct sleeping patterns from ones who agree with his views.

      Not weird if they're mostly from different continents.

      When I saw him a year or so ago he said he wasn't happy with how things were going, but never alluded to a coup. But it's his language, so good for him.

      1 reply →