News for hackers. Stuff that matters.
Re:C++26 Disapproved by wahern on Tuesday November 03, 2026 @10:56PM (#50361341)
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.
Re:C++26 Disapproved by Maxatar on Tuesday November 03, 2026 @11:02PM (#50361377)
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.
Re:C++26 Disapproved by adzm on Tuesday November 03, 2026 @11:20PM (#50361463)
So is he a hero, or villain? Does it all come down to concepts?
Re:C++26 Disapproved by afdbcreid on Tuesday November 03, 2026 @11:47PM (#50361594)
Not concepts, contracts.
Re:C++26 Disapproved by zugi on Tuesday November 03, 2026 @11:39PM (#50361561)
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.

Re:C++26 Disapproved by raegis on Wednesday November 04, 2026 @01:23AM (#50362054)
> ...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.

Re:C++26 Disapproved by hdjrudni on Wednesday November 04, 2026 @01:35AM (#50362126)
> 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.

Re:C++26 Disapproved by MFHava on Wednesday November 04, 2026 @06:57AM (#50364372)
> it's his language

It most definitely is not and hasn't been in decades.

A major problem is that some people still put his views on a pedestal, acting like he has a clean track record with his ideas, which he definitely has not - no language designer has ...

Re:C++26 Disapproved by IsTom on Wednesday November 04, 2026 @03:56AM (#50362978)
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.
Re:C++26 Disapproved by aw1621107 on Wednesday November 04, 2026 @03:45PM (#50371249)
> 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.

Re:C++26 Disapproved by locknitpicker on Wednesday November 04, 2026 @12:38AM (#50361841)
> 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++ principals. 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.

Re:C++26 Disapproved by wahern on Wednesday November 04, 2026 @12:52AM (#50361899)
I have no horse in this race[1], and tried not to use opinionated language. Of course there can't be a conspiracy when Stroustrup said what he was gonna do beforehand. But IIUC there was already a two-thirds majority to finalize the draft, so that's hardly railroading.

[1] I'm still in the C camp, and don't write C++, but contracts seem of dubious value given the lack of guarantees about whether something can be compile-time vs runtime enforced. It's sold as a safety thing but in reality it seems the value is more about optimization & performance and potentially could cause security issues of it's own.

Re:C++26 Disapproved by GeorgeWBasic on Wednesday November 04, 2026 @03:10AM (#50362665)
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?
Re:C++26 Disapproved by locknitpicker on Wednesday November 04, 2026 @06:26AM (#50364104)
> 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

Re:C++26 Disapproved by jcranmer on Wednesday November 04, 2026 @10:01AM (#50366520)
> 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.

From what I've seen of the story, the opposite is true. The people opposing contracts are the ones who have been engaging with bureaucratic chicanery to try to rip it out of the standard. In the discussions within the committee, they've been given every opportunity to make their case and had their arguments heard, even when those arguments failed to persuade anyone and are simply relitigated again and again in subsequent meetings as if they're new. In at least one national body, the anti-contracts people used the bureaucratic process to change the vote of the national body.

Re:C++26 Disapproved by kllrnohj on Wednesday November 04, 2026 @09:25AM (#50365964)
> 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.

Re:C++26 Disapproved by rerdavies on Wednesday November 04, 2026 @02:39PM (#50370482)
[delayed]
Re:C++26 Disapproved by MFHava on Friday November 06, 2026 @10:01AM (#50393156)
> 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!!??

The better question you should ask is: who determined that number and put it in their paper with a straight face?

Yes, the section on wording in P2900 is physically 56 pages. That's not 56 pages of new wording though.

For those unaware: Wording is always presented as a diff to the working draft. Apart from new sections that have to be added for contracts, those 56 pages replicate existing pages of the draft verbatim as context for their changes, which often boil down to: adding a bullet point to a list (e.g. extending the list of keywords), adding a sentence to a pre-existing paragraph (e.g. extending the syntax for lambdas), etc.

You could probably condense the wording down quite a bit, it would be harder to follow what is going on with the changes, but apparently that's what some people who just count page numbers would prefer.

Re:C++26 Disapproved by twhitmore on Wednesday November 04, 2026 @01:34AM (#50362118)
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.

Re:C++26 Disapproved by bvinc on Wednesday November 04, 2026 @02:09AM (#50362320)
> 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.

Re:C++26 Disapproved by smallstepforman on Wednesday November 04, 2026 @03:22AM (#50362745)
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.
Re:C++26 Disapproved by crote on Wednesday November 04, 2026 @05:14AM (#50363489)
The problem is that it silently overflows by default - and a good chunk of the time it is even undefined behavior. Sure, in some situations you as the developer are 100% certain that an overflow is impossible (despite the compiler not being able to prove this and therefore eliminate the checks), but in the vast majority of cases it is a footgun silently waiting to go off.

Rust tries to solve this by having basic addition panic in debug, while silently-but-consistently continuing in production: overflow is considered a bug, but it is at least not a platform-dependent bug.

If overflow is expected, then there's checked_add to detect it and fail in a friendly way, saturating_add / wrapping_add / carrying_add for specific overflow behavior.

Finally, if speed is crucial and overflow is either impossible or you don't care about the outcome whatsoever, there's unchecked_add to explicitly opt-in to a C-like "just do whatever the machine feels like".

Re:C++26 Disapproved by tialaramex on Wednesday November 04, 2026 @12:02PM (#50368454)
> unchecked_add to explicitly opt-in to a C-like "just do whatever the machine feels like".

Just like for signed integers in C the {integer}::unchecked_add is Undefined Behaviour if overflow occurs. So that's not "whatever the machine feels like" it's much worse.

This is an unsafe function, so you're expected to write a SAFETY rationale for the unsafe call, and that's your opportunity to justify to a future maintainer why you were sure this addition never overflows. If you find yourself struggling to justify that belief it probably means you should not have used this function.

If you're going to write guard code for overflows, and use that to justify the SAFETY claim, why not use the existing functions for that? Clippy will suggest this in many cases because it's less likely you will blow your own foot off.

Re:C++26 Disapproved by UFxESTER on Wednesday November 04, 2026 @08:24AM (#50365215)
I like the Employees Wash Hands sign. Recent batches of API tools seem focused on sanitizing IO: WebMCP, AI strings, safe native input parse, even Assembly mapping. So in a hot loop (whatever F35 anonymous lambda) you may have data change under you. So on antiquated hardware (like a Voyager I) maybe you want to flash the firmware to 3.5 after 70 years... but Iran has a HELLIOPARSER. It's imperative to be defensive transmitting data streams across the light years.
Re:C++26 Disapproved by Maxatar on Wednesday November 04, 2026 @03:11PM (#50370842)
No one is suggesting that every arithmetic operation is checked for overflow. The suggestion is that overflow is not undefined behavior. Getting rid of undefined behavior for overflow does not in anyway require that every operation is now checked, all it requires is specifying that the result of an arithmetic overflow depends on the platform and different platforms might produce different results.
Re:C++26 Disapproved by dwattttt on Wednesday November 04, 2026 @07:45PM (#50373533)
Defining the behaviour for overflow in the language doesn't suddenly mean the behaviour is what every program wanted. Fine that it has a defined result, but if that result isn't what you meant when you wrote a+b it's still a bug.

At a broad view, we get to a place where there's no "bug" when "what happens on overflow" is what the program(mer) wants.

Re:C++26 Disapproved by Maxatar on Wednesday November 04, 2026 @11:30PM (#50375209)
I have no idea how to parse your comment or how it relates to what I said.

All I said is that you can remove undefined behavior from signed overflow without having to introduce checks to every arithmetic operation and without having to specify any particular behavior or outcome. The technical term for this is "unspecified behavior" and the consequence of making overflow unspecified behavior is that the consequences of overflow, while still unspecified, must be bounded in space and time, unlike undefined behavior whose consequences are not required to be bounded in either space or time.

Re:C++26 Disapproved by dwattttt on Thursday November 05, 2026 @12:05AM (#50375424)
I mean removing undefined behaviour from signed overflow isn't the problem. The problem is that when a programmer previously wrote a signed operation that could overflow, they didn't specify what behaviour they really needed.

You can define a behaviour today that they'll all get, but you can't define a behaviour that matches what each programmer needed when they wrote their operation. Some of them can wrap safely. Some of them would need to saturate. Others would need it to abort.

The problem isn't that the behaviour is undefined per se, it's that you can't tell afterwards which potential behaviour the programmer needs, and choosing one behaviour e.g. wrap will break everyone who actually needed saturating, or trapping, etc.

Re:C++26 Disapproved by ho_schi on Wednesday November 04, 2026 @06:00AM (#50363848)
Yep. Safety and simplicity need to be the priority.
Re:C++26 Disapproved by MFHava on Wednesday November 04, 2026 @06:55AM (#50364360)
> Profiles

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

Re:C++26 Disapproved by guipsp on Wednesday November 04, 2026 @09:00AM (#50365624)
Profiles are vaporware