Herb Sutter: When a language’s creator and its owners strongly disagree: C++26 post-DIS, historical experience, and paths forward

60 points by mort


ralfj

Interesting writeup.

However, in its references to Rust, I think this mischaracterizes the role of Graydon Hoare. He explicitly did not want to be BDFL or have special sway over the language, and one reason he stepped back was to avoid ever causing a situation like the one C++ now finds itself in.

In fact, Graydon would usually contradict claims portraying him as "the creator" of Rust. Yes, he started the project, but Rust 1.0 is the brainchild of many people.

mort

I think this whole situation is incredibly politically interesting. The C++ standardization process is fascinating.

One thing I've been thinking about regarding the criticisms of concepts is: to me, an "obviously good", incremental change to the language would've been to add better assertions. Standardize something like Google's CHECK and DCHECK, with proper language support. I imagine a solution where C++ defines 3 build modes: debug, release and release-unchecked, then introduces modernized assert functions, std::check(bool) and std::dcheck(bool).

I personally would love something like this; I wouldn't have to try to remember whether I was meant to define/undefine NDEBUG or _NDEBUG or _DEBUG, moving more things away from macros is a good thing, it would be nice to have a standard way to define heavier debug-only checks and lighter "you probably want to run these in release mode too" checks, etc.

Yet it runs foul of one of the major issues which C++26 Contracts detractors bring up, which is that behavior changes depending on compiler settings for the particular TU and that checking behavior might therefore be different depending on the compiler settings for the TU whose implementation of a function happens to be picked.

I don't understand why this is worse for C++26 Contracts than for my obvious and minimal version, or C-style assert() for that matter. Is there anyone who could care to explain? ODR violations due to compiler settings between TUs is obviously a big problem, but it has been an obvious big problem for most of the language for the past 30 years, why does it matter more now?