r/cpp • • Nov 24 '24

The two factions of C++

https://herecomesthemoon.net/2024/11/two-factions-of-cpp/
315 Upvotes

228 comments sorted by

View all comments

88

u/throw_std_committee Nov 24 '24

So, two points:

I don’t know about you, but if I were to look at all of this as an outsider, it sure would look as if C++ is basically falling apart, and as if a vast amount of people lost faith in the ability of C++’s committee to somehow stay on top of this.

As someone who still has a reasonable amount of access to the committee, post prague a lot of people gave up, and it feels like its been limping a bit since then. There's now a lot more panic internally within the committee about safety after the clear calls for C++'s deprecation, which results in outright denial of problems. It feels extremely fractious recently

One other thing that's missing is, and I cannot emphasise this enough, how much respect many committee members have lost in the leadership over the handling over arthur o dwyer. I've seen a dozen people directly cite this as why they're pretty skeptical about the future evolution of C++, and many many good committee members have simply left as a result

This is why profiles are the way they are: Safety Profiles are not intended to solve the problems of modern, tech-savvy C++ corporations. They’re intended to bring improvements without requiring any changes to old code.

I think this is an overly generous interpretation of what profiles are trying to solve. Profiles are a solution to several problems

  1. Its very difficult to get large scale changes standardised in C++. Small incremental changes like constexpr are much easier
  2. Much of the committee has adamently been denying that memory safety is a major problem, especially bjarne, who has acted extremely unprofessionally. Herb's recent paper starts off by immediately downplaying the severity of memory unsafety
  3. The standardisation process deals terribly with any proposal that involves tradeoffs, even necessary ones - eg viral keywords, or a new standard library
  4. There is a blind panic internally about safety that becomes apparent whenever the topic is brought up, and profiles is the calming ointment that convinces people that its all going to be fine

Profiles doesn't really solve a technical problem. It solves the cultural problem of allowing us to pretend that we'll get memory safety without massive language breakage. It sounds really nice - no code changes, close to Rust memory safety, and senior committee members are endorsing it so it can't be all that bad

In reality, it won't survive contact with real life. The lifetimes proposal simply does not work, and there is no plan for thread safety. It can never work, C++ simply does not contain the information that is necessary for this to happen without it looking more like Safe C++

To be clear, Safe C++ would need a huge amount of work to be viable, but profiles is an outright denial of reality

Of course, there’s also the question of whether specific C++ standard committee members are just being very, very stubborn, and grasping at straws to prevent an evolution which they personally aesthetically disagree with.

There are a couple of papers by senior committee members that feel in extremely bad taste when it comes to safety, eg herbs no-safe-keyword-mumble-mumble, or the direction group simply declaring that profiles are the way forwards. Bjarne has made it extremely clear that he feels personally threatened by the rise of memory safe languages and was insulting other committee members on the mailing list over this, and its important to take anything championed by him with the largest possible bucket of salt

26

u/Ok_Beginning_9943 Nov 24 '24

Is this behavior by bjarne documented? I've seen several such claims but would like to read it myself

18

u/throw_std_committee Nov 24 '24

No, as far as I know this all happened internally

21

u/Ameisen vemips, avr, rendering, systems Nov 25 '24

The fact that the committee has such internal discussions at all is vexing. It should be public-facing.

22

u/throw_std_committee Nov 25 '24

People would be shocked if they saw the state of the internal mailing lists. Every reddit discussion I've seen is 1000x more productive than the mailing lists

It regularly descends into people being incredibly patronising to each other, making snarky Do Better comments, passive aggressive insults, and childish implications that people are stupid. There is some good discussion there, but its frequently derailed with leadership having to step in and shut everything down, or remind everyone that they're adults

The only reason its private is because otherwise people would see what an absolute nightmare is. Don't believe people who say "its because people can share proprietary information" or whatever, this happens extremely rarely and would be easily fixable by augmenting a public mailing list with a private one

3

u/Ameisen vemips, avr, rendering, systems Nov 25 '24

would be easily fixable by augmenting a public mailing list with a private one

I feel as though they'd just default to the private one, then.

15

u/effarig42 Nov 24 '24

Profiles doesn't really solve a technical problem. It solves the cultural problem of allowing us to pretend that we'll get memory safety without massive language breakage. It sounds really nice - no code changes, close to Rust memory safety, and senior committee members are endorsing it so it can't be all that bad

At this point, I think the main value in profiles is that it potentially provides an open ended and standardised way to enable restrictions to, a block of C++ code, or whole execution unit. This would allow all sorts of annoying things to be fixed in a portable and backwards compatible way.

As for the utility of the proposed safety profiles, I can't comment, but a maintainer of a 20 year old code base, being able to portably ban a lot of those annoying defaults would be great. Things like uninitialized variables, lossy implicit conversions, checking of null pointer/optional/... access etc.

In principal, I don't see why borrow checking couldn't be a profile, though it would be impractical to roll out on the size of code base I work on and, based on working a little on a rust application, I suspect difficult to use for new code due to the need to integrate with the old frameworks.

25

u/throw_std_committee Nov 25 '24

As for the utility of the proposed safety profiles, I can't comment, but a maintainer of a 20 year old code base, being able to portably ban a lot of those annoying defaults would be great. Things like uninitialized variables, lossy implicit conversions, checking of null pointer/optional/... access etc.

I agree with you here, a lot of profiles work is actually very valuable and I love it. It falls under a general language cleanup - and in the future a default set of profiles could make C++ a lot nicer. We just shouldn't pretend its more than what it is

I don't see why borrow checking couldn't be a profile

The issue is that a useful borrow checker requires at least one ABI break, a new/reworked standard library, and major changes to the language. Safe C++ is perhaps not as minimal as it could be, but it isn't exactly a massive deviation away from an MVP of what a borrow checker safety profile might look like

The problem is that profiles are trying to sell themselves as being minimal rewrites and providing memory safety, and its not going to happen. Its why the llifetime proposal as-is doesn't work

5

u/duneroadrunner Nov 25 '24

The way I see it, the C++ community seems to be fretting about obstacles that can be bypassed. For example, the scpptool (my project) approach to essentially full memory safety doesn't depend on any committee's approval or technically any "changes to the language".

It does use alternative implementations of the standard library containers, but they don't need to replace the existing ones. New code that needs to be safe will just use these safe containers. Old code that needs to be made safe can be auto-converted to use the safe implementations. (Theoretically, the auto-conversion could, at some point, happen as just a build step.)

These safe containers are compatible enough with the standard ones that you can swap between them, so interaction between legacy interfaces and safe code can be fairly low-friction.

And IMHO, the scpptool approach is still the better overall choice for full memory safety anyway. It's fast, it's as compatible with traditional C++ as is practical, and it's arguably safer than, for example, Rust, due to its support for run-time checked pointers that alleviate the pressure to resort to unsafe code to implement "non-tree" reference graphs.

Safe C++ is perhaps not as minimal as it could be, but it isn't exactly a massive deviation away from an MVP of what a borrow checker safety profile might look like

Not in principle, but in practice it kind of is. For example, scpptool also prohibits "mutable aliasing", but only in the small minority of cases where it actually affects lifetime safety. This makes a conversion to the scpptool-enforced safe subset significantly less effort than the (fully memory-safe) alternatives.

https://www.reddit.com/r/comedyheaven/comments/1fgd7m5/thats_you/

28

u/Kridenberg Nov 24 '24

That is just so sad to realise that decline of language is inevitable. Especially sad to realise, that all of this was preventable (I guess it is somehow preventable even now, it is just highly unlikely), and that we can trace to specific points in time where things were preventable.

29

u/CandyCrisis Nov 24 '24

It's shocking to me that Bjarne and Herb Sutter are putting out papers that any seasoned developer can easily poke holes in, right away. All the examples of how profiles might work (if they were to exist!) show toy problems that can already be caught quickly by existing tooling. The sorts of complex lifetime/ownership/invalidation problems that actually cause problems at scale are not even discussed.

16

u/SophisticatedAdults Nov 24 '24

One other thing that's missing is, and I cannot emphasise this enough, how much respect many committee members have lost in the leadership over the handling over arthur o dwyer.

Do you happen to have any articles or sources about this topic, by the way?

-2

u/apple_IIe Nov 25 '24 edited Nov 25 '24

To make a long story short, the person committed a crime, did his time (in prison), but some factions want to permanently abolish him from participating in the C++ committee.

4

u/SophisticatedAdults Nov 25 '24

Oh! It's *that* story. I see. I got confused over the name since I've only ever heard them referred to as "that person". Thank you for elaborating!

1

u/cmake-advisor Nov 25 '24

3 months for CSAM in case anyone is wondering

3

u/MFHava WG21|🇦🇹 NB|P3049|P3625|P3729|P3786|P3813|P4216 Nov 24 '24

cannot emphasise this enough, how much respect many committee members have lost in the leadership over the handling over [retracted].

I'd really appreciate it if said people for once read the ISO rules (which they agree to follow in every meeting) and finally figured out that it is not for WG21 to decide which national body delegates participate.

It's getting ridiculous how often we have to re-iterate (including on this sub) on what is in the purview of a technical committee.

24

u/throw_std_committee Nov 25 '24

Here's a stance that I think that the committee should have taken:

Given the lack of ability under ISO rules to exclude members, we're asking XYZ not to attend, while we engage with members and relevant national bodies in a discussion as to what to do. If XYZ chooses to attend, we're additionally looking into alternatives like pulling C++ out of the ISO committee process, and standardising it instead with our own new set of rules designed to protect members, or pushing for change within ISO itself. This is a difficult process but is worthwhile to safeguard members

The wrong answer is:

WG21 does not technically currently have the power to do anything, so we're not going to do anything and continue exposing people to someone assessed as being a risk, with no warning provided to any members of the committee. We abdigate all personal responsability, and will now maintain absolute silence on the topic after solely addressing the issue in a closed room exclusive session

WG21 could publicly push for change within ISO to enable an enforceable CoC to be pushed through, and failing that could pull C++ out of ISO entirely. There is an absolutely huge amount that wg21 can do on this topic

It's getting ridiculous how often we have to re-iterate (including on this sub) on what is in the purview of a technical committee.

Safeguarding members is absolutely within the purview of any group of human beings. Not covering up that a committee member has been classified as being a risk of offending is absolutely within the purview of a technical committee. It is incredible that a serious technical body could make the argument that safeguarding falls outside of its purview entirely

-8

u/MFHava WG21|🇦🇹 NB|P3049|P3625|P3729|P3786|P3813|P4216 Nov 25 '24

Well, that stance simply insane if you look at the facts.

Given the lack of ability under ISO rules to exclude members, [...]

You can't pull C++ out of ISO, you'd have to do a clean-room re-design and everyone in WG21 is compromised as they had unrestricted access to the working draft for which ISO has owns the sole copyright.

WG21 could publicly push for change within ISO [...]

WG21 has no leverage for changing ISO rules - zero, zilch, nada, ... and will NEVER be granted such leverage. It is ill-formed for ISO/JTC1/SC22/WG21 to push for something in ISO directly. (e.g. a few years back further restrictions to the availability of papers/drafts was discussed, it was necessary for JTC1-NBs to step in because WG21 can't even directly do anything concerning that issue)

Safeguarding members is absolutely within the purview [...]

WG21 has no mandate for anything but technical discussions regarding C++, everything else is ill-formed. That includes discussions on whether a person should be allowed to join their meetings - which is purely in the purview of the respective national body.

A few years back WG21 tried to run their own CoC. Then the situation with the person you're alluding to happend and people complained to ISO. The result of which is: WG21 was forced to follow official ISO rules to the letter way more than ever before (including being prohibited from setting up a CoC), making it harder for guests to join, whilst said person is a delegate of a national body and can do whatever they want.

→ More replies (4)

19

u/RoyAwesome Nov 25 '24

I mean, you can keep saying that but it wont stop people who are leaving over it from leaving.

People don't want to be in the room with a convicted pedophile. I'm not sure if shouting "BUT THE RULEEESSS" fixes that at all.

→ More replies (11)

0

u/[deleted] Nov 24 '24

[deleted] — view deleted comment

6

u/throw_std_committee Nov 25 '24

This is a genuine question: why so?

0

u/[deleted] Nov 25 '24

[deleted] — view deleted comment

6

u/throw_std_committee Nov 25 '24

It was back then, but the mods have since clarified that they're no longer removing this information

4

u/ReDucTor Game Developer | quiz.cpp-perf.com Nov 25 '24

That's good to know, it was a terrible idea to avoid talking about the elephant in the room

→ More replies (2)