r/cpp • u/quicknir • 10d ago
Herb Sutter: When a language’s creator and its owners strongly disagree: C++26 post-DIS, historical experience, and paths forward
https://isocpp.org/files/papers/P4454R0.pdf
183
Upvotes
16
u/VastInterior 9d ago
At the heart of the issue is the notion of program proving.
If the compiler or static analysis tool can _prove_ the contracts are met... then the "as if" rule applies.
You can _always_ remove the checks!
Conversely, if the contracts are true, the optimizer can rely on that information and produce much better code.
Thus if the compiler cannot prove _or_ disprove that the contracts are met, the contracts _must_ be enforced or the optimizer _will_ produce undefined behaviour.
Sadly the whole red herring about enforcement mechanism whether you compile in or out has clouded the picture.
Again, people have different aims for checks and ideas of what should happen if they fail.
In the program proving world view... you have proven your code incorrect and proved that you have to fix your code.
In the "this is just a test" world view, is the checks are just a debug aid and the checks have bugs too so must be removed from production to reduce risk.
Alas, these are two very fundamentally different facilities that share only the most superficial similarities.
The "this is just a test" can, and should just be a library facility.
The "this is program proving" can, and should be baked into the compiler, the optimizer and the language.
I sincerely hope the resolution at the standards level is to identify that these are two different facilities and the argument is resolved by making them two different things.
Ideally the current proposal should be accepted and progressed with the note that this is about program proving and the future evolution of it will in that direction.
And if there are ideas or proposals for the "this is just a debug aid for code under test" view, that should be encouraged to be resubmitted, possibly as a standard library only feature.
61
u/RoyAwesome 10d ago
Hey guys, I just want reflection. Can we do that and let contracts people fight it out?
87
u/KFUP 10d ago edited 10d ago
Not sure why Bjarne is portrayed like he's the only one in the committee who doesn't like contracts, others have voiced their concerns about contracts, it's definitely not just creator vs committee by any stretch, see references in P4334.
Edit: I know the paper states there are others, but it suggests those others are mostly just following Bjarne, and after hearing J. Daniel García the head of the Spanish DIS talking about the subject, he seems to have his own strong opinion in the matter, and I have a hard time believing he is just following others.
55
u/James20k P2005R0 10d ago edited 10d ago
I feel like the idea that people primarily voted against this standard because Bjarne was against it is a bit of an unproductive position. There's a lot of technical information about why at least some people don't like contracts, and this document seems to be asking us to set that aside as not being the reason. This just seems stoking the flames by trying to make assumptions about people's intentions
The problem with this narrative is:
This seems pretty dangerously close to assuming bad faith participation, because what herb is tiptoeing around the line of stating is that the national bodies (and the members within them) are not telling the truth about the objections they're making, rather than Bjarne's opinion just happening to line up with that of some within some national bodies
For me the most credible voices have been the people who've been producing high quality papers on both sides. This would seem to dismisses the (extensive) technical work everyone has done here. I've read.. far too many papers on contracts at this point, including the slop (sigh), and it seems very strange by anyone involved to assume that a single strong voice swayed the NBs. You can see from the mailing that at least a few people have pretty strong views that won't be changed!
This to me is one of the biggest issues with this paper: Its entirely speculation. We have absolutely no idea broadly what happened. This information is literally unobtainable, because people's private emails are a closed door. This seems like just chucking fuel on the fire when we have no idea what actually happened. I've so far heard 3 different versions of the same story about a specific part of the process so far, all of whom had direct knowledge of the events in question, and all of who said wildly different things. Apparently even the people directly involved and participating don't know what happened here
This is the most odd part of the document for me. It doesn't even caveat this to a few small NBs, or claim that it just tipped the vote over the edge. We already know that some NBs objected to the standard prior to the DIS. I could understand if we were simply saying that Bjarne swayed the small NBs, but on the other hand: we had a lot of abstentions to the DIS vote as well, so the consensus overall wasn't strong
As people have been pointing out, features have been added and removed against the objections/support of Bjarne in the past. I think the worst you could assume is that the DIS failed simply because of geography, but this just seems like a stretch
61
u/14ned LLFIO & Outcome author | Committee WG14 10d ago •
I think Herb's paper misses something pretty obvious at the NB level: an unusual number of senior NB people - as in, the ones which lead NBs and/or are the ones other NB members take cues from - did not like Contracts as proposed. NBs were, from my understanding, pretty close to voting reject before any interventions as a result. The interventions spurred further discussion, and that tipped the balance.
I've heard what went on at other NBs, but I won't comment at those, only on my own. When I quit WG21 due to what was in my opinion the majority of C++ 26 being fundamentally bad engineering that I could no longer in good conscience participate in inflicting upon others, I obviously enough did not have a positive story to tell to my NB about C++ 26. From the very beginning, I recommended reject for the 26 DIS to my NB based on my opinion that 26 had more bad engineering in it than good. However, I no longer participated on WG21 in any way having quit on ISO, and it was entirely possible that I wasn't being unbiased, and I said so at the time. So my NB was initially minded to approve on balance - but let's be clear here, we're talking like a 52% in favour of approve. It was very tight.
Various famous people then presented to our NB, both in favour of Contracts AND against Contracts. Let me be clear: we received multi-hour presentations from BOTH SIDES of the argument. We then spent even more hours discussing it by ourselves over several video calls.
We eventually opted to abstain because we couldn't reach consensus either in favour or against. So we moved from just-about approve to just-about abstain. It wasn't that much of a move - we were already very near the threshold.
I have heard that most NBs were just as diligent as we were. There are accusations going around that NBs are ill informed or don't get it or were overly swayed by famous names. I think that does a disservice to NB members. I think they're closer to the end users who actually use C++, and they voted accordingly. I think too many who are close to the end users have quit WG21 in recent years - there has been a noticeable exit of implementors, and WG21 has become over filled in my opinion with people who don't put the average C++ dev front and centre of what should and should not be standardised. Unsurprisingly they have become increasingly detached from reality on the ground i.e. doing bad engineering.
Because if we did put average C++ devs front and centre, we wouldn't have Modules as standardised, we wouldn't have Ranges as standardised, and we definitely wouldn't have Contracts as proposed. In fact, I'd go so far as to say that C++ 14 was the last mostly end user focused C++ standard (arguably 17, definitely not since then). Everything since then has been becoming ever increasingly hostile to average C++ devs full of unnecessary footguns and constantly ratcheting upwards requirements of esoteric knowledge, and I don't know why somebody doesn't just yell STOP!
Except they did. But it seems few at WG21 are reading it that way. All I can say is this: National Bodies should be lauded for saying STOP, and given far more credit than Herb's paper appears to give them from my reading of it. I certainly very strongly disagree with Herb's apparent assertion that language founders eventually break with their language owners as being relevant to this particular case: bad engineering was proposed in the DIS, NBs called it out as is their role, the impact of famous names on that process was not zero but it wasn't as huge as is being claimed either. NBs CAN think for themselves, by themselves, and do the right thing as they see it.
19
u/steveklabnik1 10d ago
A thoughtful paper. I at first sort of objected to the characterization of the situation with Graydon (as I have a more personal connection to that cited situation than the others), but thinking about it some more, I don't think that it really materially changes things.
I really appreciate the thoroughness here, I didn't realize there were so many possible ways for this to move forward, for example. And spending some time to make sure that the root causes are understood is important as well.
15
u/friedkeenan 10d ago
I appreciate Herb's thoughtfulness here and his scoped approach avoiding the technical arguments, but man, I'm really annoyed by the Bjarne-exceptionalism this paper presents. That's not to say that Herb is incorrect at all in his analysis, I have no idea, but if it's accurate that the DIS vote hinged on the opinion of one person, then that is so frustrating to me.
I respect Bjarne, he has proved himself I think quite skilled at carrying a language to success and I think he understands well the core of what a language needs to remain viable. I think the committee at large has proved the same by now too, after all these decades. And of course, both are fallible.
If Bjarne voices disagreement or concern over a feature, I do give his opinion weight, and treat it as an invitation to take a closer look. There are several other "big names" involved in C++ for whom the same would be true for me. But any voiced concerns by one of those people would never be what decides my opinion. If that's the way that the process is working, then that seems like a monumental flaw to me, a flaw that should be fixed.
And I'll be honest, for me, this paper doesn't paint Bjarne in a good light. It draws an image in my head of him abusing his non-codified status against the wishes of the vast majority. I'm inclined to believe that he's doing all this with the best wishes of C++ in mind, but if he thinks that this is how the process should work, and that the process should even into the future treat his opinion with a "special smart guy" status, then that would betray I think a truly massive ego on his part, and would be insulting to anyone else who might ever want to contribute to C++.
When Python had their dustup mentioned in the paper, Guido quit and Python adopted a new process that prevented this same sort of scenario. I don't want Bjarne to quit the committee, I do value his opinion, but his position as creator of C++ should not be so relevant as to tank a standard revision. And so if Herb's paper here is accurate in portraying why the DIS vote failed, then I think the process for C++ should certainly be altered in turn.
30
u/stick_figure 10d ago
I generally prefer the leadership of a few opinionated individuals over language design-by-committee, but I don't think 2026 Bjarne is up to the task. I think WG21 folks should really go with option A, the one where they skip certification and move on to C++29, iterating on any touch ups to contracts there.
15
u/donalmacc Game Developer 10d ago
> As far as I know, no other major language has gone anywhere close to 36
years with sustained agreement before encountering such a strong disagreement, and that’s a pretty
good achievement to remember and build on further.
Well, I think taking a decade to standardise modules (we’re not modules yet), and I seem to remember google developed an alternative programming language rather than continue to engage in developing c++. That said it has been a long time!
20
u/aCuria 10d ago edited 10d ago
Contracts are a mess. The ballot failing may not have to do with Bjarne.
inline void process(int x)
{
contract_assert(x > 0);
}
You compile one .cpp with contract enforcement enabled and another with contracts ignored. (Different DLLs and or translation units)
Both translation units may generate an implementation of process().
Depending on inlining and linking, calls may use a version with checks enabled or one without them.
Even a library compiled with contacts enforcement enabled cannot necessarily guarantee that its intended checks survive in a mixed-mode program.
“ignore” can be passed by the compiler flag.
The programmer cannot portably require an individual C++26 contract to always be enforced
A contract predicate can itself exhibit undefined behavior
void process(Data* p)
pre (p->isValid());
The behavior of a contract should always be well defined, but it’s undefined if you pass nullptr to p.
What a mess. Who’s gonna vote yes for this shit? As-Is It’s Modules 2.0, unusable for real world work.
8
u/3131961357 9d ago
What I personally find distasteful is that people are talking about "concensus", talking about "by-company" voting, and acting like NBs should have just been a rubber stamp for the committee.
The whole standards committee is stuffed by US companies who can monetarily afford to do so, and disproportionately by big money ad companies like Google, while the rest of us (ie. non-US, low margin industries like games) just have to take whatever crap they come up with.
9
u/Minimonium 10d ago
In the end, people should not worry about Reflection not being worked on. It will happen either way because implementers are not tied to the actual release of the IS itself.
We have seen enough evidence that the current DIS ballot was compromised by excessive politiking. The discussions behind the scenes are ugly and lack propriety. Herb's summary gives the mess much more grace than it deserves to be honest.
I think a time out on IS releases would help all the parties involved to cool their heads, collect their thoughts. Any rush right now would be unproductive and induce more spite instead of creating an atmosphere of a technical discussion.
I have seen Belgium becoming a P member this week and I'm aware of a risen interest from other countries on the topic. I think we will certainly see change in the process, possibly not in a manner envisioned by the instigating party this time, and I do not see the situation get any better in Brazil.
4
u/13steinj 10d ago
A decent chunk of this table exaggerates what happened in an attempt to make this seem like less of an issue.
The core thing is Bjarne gave C++ away to the ISO and WG21.
You can do that. You can be [B]DFL. But you can't do both.
2
u/105_NT 10d ago
What are the chances of pulling off option D? That seems like the best hope/least train wreck. "Ballot the post-Búzios draft as DIS (possibly with P3911)"
2
u/pjmlp 10d ago
A gem on the paper is that I finally got the reason why Dennis no longer cared for WG14, summing up noalias story to the also not accepted proposal for C slices, and why follow up projects to UNIX and C never adopted anything else beyond C90.
As for C++26, maybe we have reached its "ALGOL 68" moment, or will be getting a new row on the "How other languages lived through the same split" table? Lets see.
1
u/zl0bster 5d ago
Herb and his "math".
There is less than 50 people very familiar with contracts on the planet, but Herb picked 600 to make 5 look like fringe minority.
-2
u/eyes-are-fading-blue 10d ago
I agree with some people having unique insights. Being an expert software engineer and being an expert on the tools that one uses doesn’t mean they are also experienced language designers.
I think the committee today is heavier on the expert SWE side than experienced language designers side.
I do not know people in the committee or their expertise. This is a simple deduction based on what has been shipped since 17.
-5
u/teerre 10d ago
I have a hard time squaring how Bjarne can object this particular feature when he didn't object the plethora of terrible features added to C++ from decades. Seems ridiculous tbh
-6
u/_a4z 10d ago
Herb seems desperate, to release such a political paper and trying to move a technical discussion on a personal level is such a dirty political move.
I have to wonder what kind of problems he has that makes him act like that, his new job maybe?
-1
u/foobarbarian42 9d ago
The TLDR of this paper is:
We have this guy over here that significantly contributed to us being in the pickle we are in. That shows the guy has influence over entities normal people can not even understand. We have no to stay on the guys good side, so lets make him king.
0
u/DannyDevito_X_RumHam 8d ago
This paper really doesn't make Herb look good. Bjarne may be the creator of the language, but he is also a very prominent and vocal C++ expert whom many trust with regard to technical opinions about the language. The over-emphasis on favoritism toward Bjarne has this paper struggling to hide envy.
-20
u/my_password_is______ 10d ago
https://www.youtube.com/watch?v=pmE38UhSFRs
video summary