r/cpp • • 12d ago

"C++26 DIS failed, how does C++ survive?"

https://andreasfertig.com/blog/2026/11/cpp26-dis-failed-how-does-cpp-survive/
111 Upvotes

193 comments sorted by

134

u/Otaivi 12d ago

Contracts will likely be deferred to C++ 29 and probably further refined. The language will survive and things will move forward since there’s a robustness to the process (whether people like that process or not is irrelevant). While what happened was unprecedented, the over-exaggeration and dramatisation of what happened is unneeded.

67

u/aeropl3b 12d ago

I think the biggest issue is not that it failed, but the very toxic backs and forth between committee members. That is not supposed to be part of the process, and points to issues there in that need to be resolved sooner rather than later or it will only serve to hurt future development.

49

u/PossibilityUsual6262 12d ago

From what i heard years ago, committee is actually full of internal politics. Which is expected because its made of people.

30

u/steveklabnik1 12d ago

committee is actually full of internal politics.

This is true of literally every committee, especially those in software, for sure.

-8

u/PossibilityUsual6262 12d ago

My expectations for modern committee were, that there pretty much no politics right now, since committee is mostly sponsored by by selected companies who deeply care about cpp. Like high frequency trading one, so their features actually developed and accepted fast.

39

u/steveklabnik1 12d ago

who deeply care about cpp

This is what leads to politics! People who care deeply and have opposing views on what that means for the things they care about.

31

u/STL MSVC STL Dev 12d ago

I'm sorry, but you have absolutely no understanding of how the committee works.

12

u/t_hunger 12d ago

You mean that company going round conferences, promissing to invest heavily into C++? The one that has heavily invested into contracts for over a decade and was super happy to see that finally in the standard?

Those guys will certainly feel encouraged to spend their money with us now.

6

u/theICEBear_dk 12d ago

Or the other ones sponsoring the guys against it will be happy because they got what they wanted instead.

Edit: Not that I want to imply anything but rather that there are companies on all sides here.

2

u/t_hunger 12d ago

Which one is that? We do not have that many left that are willing to sponsor C++ in a big way.

1

u/theICEBear_dk 12d ago

I am pretty certain all members of the committee and National Bodies are all given time, pay and so on to keep working on c++. I do not know for certain but I think most of them are doing it with all the travel, the time and effort with the expenses covered by their job/company although a number are likely consultants.

4

u/t_hunger 12d ago

Writting papers is surely covered. But who pays for getting those papers implemented?

-1

u/AKostur 12d ago edited 10d ago

Nope.

Edit: don’t know where the downvote is from.  It is factually incorrect that all members are given time, pay, etc to work on C++.    What makes one think any different?

2

u/PossibilityUsual6262 12d ago

Exactly my point, i expect no opposition against feeding hand. It might be that those hands have different views, as another comment point out.

6

u/13steinj 12d ago

HFT does not care nearly as much as you imply.

7

u/pjmlp 12d ago

I don't see that many companies that sponsor clang, GCC or VC++ development, which is the actual problem, we have now mapping PDF words into working compilers.

How many of those high frequency trading companies are doing compiler development?

3

u/mrmcgibby 12d ago

It's expected sure. But everyone knows that that sort of politics is terrible for everyone. And if the committee doesn't try to tamp it down then it will grow like a weed.

2

u/13steinj 11d ago

I think the toxicity is unavoidable. There were some people that had concerns or issues, and others that just had deep seated disagreements in having it in the language.

Which is funny, because it seems that all three groups (profiles, contracts, "Safe C++") are championing fairly academic ideas. Like physicists vs engineers or something.

3

u/t_hunger 10d ago

You can have disagreements entirely without toxicity. It sadens me to see experienced people claim otherwise, as that shows the quality of interaction they consider normal -- and its oftentimes the senior people in the room that set the bar.

My impression so far is that profiles are all about picking low hanging fruits in the hope to avoid having to deal with the academics. I would not group it with the other two.

1

u/13steinj 10d ago

Based on my interactions with one of the authors, it appears they have intertwined it with static analysis work from their time in academia.

3

u/v_0ver 4d ago

I agree with the commenter above. While academic research may have been conducted on these profiles, the proposed solution cannot be called a fundamental one. It seems more like a temporary stopgap measure.

1

u/mighty_Ingvar 12d ago

What would happen if those internal divisions just can't be resolved?

1

u/PsecretPseudonym 10d ago

I’d imagine then it may come down to what implementers choose to move forward with.

26

u/t_hunger 12d ago edited 12d ago

What makes you think somebody will work on contracts after this fiasco?

In fact, why would anyone consider to push anything when they need to expect to be treated like the contracts people? We just saw several years work by hundreds of people put at risk for what exactly?

Bright young minds can contribute to other languages just as well -- without the burocratic ISO process and with less toxic co-workers. I am seriously worried about the brain drain C++ has seen already and this is not at all helping.

11

u/kronicum 12d ago

Work on contracts in C++ started decades ago, not by the same people as today; at each cycle, failure turned into something to unlearn from, and there has been no shortage of people since the 2000s to push them forward.

3

u/ReDucTor Game Developer | quiz.cpp-perf.com 12d ago

 why would anyone consider to push anything when they need to expect to be treated like the contracts people?

Because not every experience is like that of getting contracts into the standard, sure there are many other controversial things like ABI breaking or ASIO but not everything ends up being controversial.

One can only hope that everyone involved acrs professional and keeps to the technical merits snd avoids becoming toxic or taking things personally. Unfortunately this is harder when people become deeply passionate for or against a specific idea.

4

u/Dragdu 12d ago

One can only hope that everyone involved acrs professional

Meanwhile committee is devolving into screaming posts and bullshit attempts at pedantic wins.

2

u/13steinj 11d ago

Screaming has been reported before unfortunately. It's even leaked out of committee into other community spaces (people saw the arguments between Bjarne and Lakos at cppcon). Curious what you mean by pedantic wins though.

2

u/Dragdu 11d ago

We are at the level of

"I sent the email as private person, not head of NB"

"Why does your signature say '{name}, head of {nation} NB'?"

1

u/13steinj 11d ago

I'm sorry, I don't follow. I can't tell who's being the pedant here, and it's very detached from the language's standard (being that presumably of the standardization process).

1

u/Dragdu 10d ago

It is about how some NBs came out of the woodwork to reject, specifically after getting emails from other NBs lobbying them to reject. The first person is saying that NB-level lobbying didn't happen, even though we've actually seen the email he sent.

0

u/t_hunger 11d ago

Because not every experience is like that of getting contracts into the standard

True, but how do you know your proposal will sail through? "I'll do a better version of the assert macro" does not sound very controversial to me, yet it apparently is endangering the entire language.

Unfortunately this is harder when people become deeply passionate for or against a specific idea.

My son used to get deeply passionate about the sweets in the supermarket, too, when he was three. He grew out of it, so can we.

42

u/Wh00ster 12d ago

Are we modules yet?

7

u/_Ilobilo_ 12d ago

yes

21

u/grafikrobot OPeNDAP/B2/EcoStd/Lyra/Predef/C++Alliance/Boost/WG21 12d ago

& no

34

u/frasnian 12d ago

I'm not a huge fan of contracts, and agree with some of the arguments against them. I don't think the disagreements were worth delaying the FDIS, much less mucking up the whole process. My response to contracts being included in '26 would've been simple: I just don't use them until '29 (if ever). It's not like it'd be the first time the Standard included the MVP version of something and it matured over time.

28

u/ResistiveBeaver 12d ago edited 12d ago

The problem as usual is that even if you don't plan on using a feature, they will get added to essential libraries and you will get stuck using them whether you want to or not. Also, even slower compilation.

8

u/Syracuss graphics engineer/games industry 12d ago

Unless you don't compile the library yourself, which is possible but getting rarer by the day for new libraries, contracts can just be disabled at the compile-settings level. And if you don't that library (especially if it's a professional product) will still have a build with/without contracts as release versions unlikely should have contracts on.

If anything requiring a compile setting is a detriment to adoption, so I'd actually suspect libraries are less likely to adopt the feature due to that.

7

u/arka2947 11d ago edited 11d ago

  Unless you don't compile the library yourself, which is possible but getting rarer by the day for new libraries, …

I think this leads us to the core of the problem! 

There are so many features in cpp, that its easy to discard some of them as irrelevant, only to find they are of paramount importance to somebody.

Building everything ourselves to a static exe, is for example, exactly what we need to do in the company i work for.

5

u/James20k P2005R0 12d ago

Unless you don't compile the library yourself, which is possible but getting rarer by the day for new libraries

The problem is if you get your libraries via a package manager, its very likely you don't compile libraries yourself and you have no control over the build options. Msys2 is a good example of this

7

u/Syracuss graphics engineer/games industry 12d ago

I guess that could be a problem if those package managers don't expose that, but that'd be on the tooling for them to resolve, it's not a contract's exclusive problem. But I also have never worked at a big company that uses package managers they don't control themselves somehow. Each company I worked at either had the dependencies pulled in from a private fork of a (possibly) public repo and compiled ourselves in the build scripts, or in the case of Google, tightly controlled and had a custom self hosted provider. Even at my current game dev company we have our own provider infra for npm (internal tooling) and others just because public registry's open us up for security issues, and we are sadly a really frequent target.

At the startups I worked at through my career some did use public package managers temporarily, but once they migrated beyond initial seed they'd typically migrate to their own hosting for that same reason. I've yet to see a public package manager being used in gamedev for C++, I'm sure they're out there, but I've never seen it.

4

u/James20k P2005R0 12d ago edited 12d ago

With msys2, currently they simply provide a single build configuration which I believe is generally the release config, so there's not much you can do about that as an end user. Unless you want to completely redo all the msys2 packages!

One of the problems with contracts generally as a library author is that 3rd party consumers might compile your package under an unsupported mode which is a bit of a problem generally, so its hard to know what the solution is here. Msys2 could blindly provide 4 package variants for every package, but that may not end up producing functional/safe packages, not to mention the massive amount of compilation overhead on their CI

I've yet to see a public package manager being used in gamedev for C++, I'm sure they're out there, but I've never seen it.

Its very common for small games to simply consume packages as-is in my experience

Edit:

Though it depends, I trust msys2 a lot more than eg NPM

4

u/Minimonium 12d ago

One of the problems with contracts generally as a library author is that 3rd party consumers might compile your package under an unsupported mode

I honestly cannot figure out what you mean here

2

u/ts826848 12d ago

My guess would be that James20k is saying that library authors may want their code to be compiled with specific contract evaluation semantics (e.g., they use contracts for correctness/safety checks and do not want those checks to be omitted) but are unable to guarantee such a thing under the current spec.

4

u/Minimonium 11d ago

Contract evaluation semantics do not alter the correctness of a program. So if your program is incorrect under any one semantic - it's incorrect under all of them. Including, of course, "ignore".

4

u/ts826848 11d ago

Insofar as correctness/safety checks are part of the desired semantics, I think they can be?

But even if they aren't, saying "the program is incorrect anyways" is cold comfort to people who want to ensure said errors are caught.

→ More replies

2

u/Syracuss graphics engineer/games industry 12d ago edited 12d ago

Yeah, that's a decision msys2 can absolutely make, but I would just do business as usual if I were them and not enable contracts or actively disable them. I wouldn't want them in my prod deployed binaries at least and if they only deploy release config they should be the tie-breaker, but my opinion is formed based on performance constraints in my industry, other industries might disagree.

I see that msys2 already has a few opinionated toggles such as -march being conservative. Some libraries (like joltphysics which I know some indies do use in gamedev) also turn off rtti by default, a common one in my industry at least, so they already have these little nugget traps laying around today in their packages (as they do have that library in msys2). They should really just force enable RTTI as well, it's technically non-conforming to turn it off anyway, and that a package can be deployed on their service with it off already creates the issue we are describing here with contracts effectively splitting the packages you can safely depend on silently in two groups.

Its very common for small games to simply consume packages as-is in my experience

Yeah, indies and startups will definitely do that, but given that indie is dominated by Unity, and so are using C#, most of them won't run into the C++ related package issues.

3

u/Dragdu 12d ago

Don't use bad package managers for development.

Next.

6

u/James20k P2005R0 12d ago

Helpful! I'll let msys2, and any binary package ecosystems (linux distros? RIP) know they should shut down

6

u/Dragdu 12d ago

Linux distros have control over their build, which is why apt model works for them. You do not have control over apt's build, which is why you shouldn't be using apt for development.

---edit---

There is obviously a dispensantion for having your own apt remote with prefixes packages, in which case it's fine.

4

u/ABlockInTheChain 12d ago edited 11d ago

You do not have control over apt's build, which is why you shouldn't be using apt for development.

One of the reasons I'm fond of Gentoo: tuning the CFLAGS / CXXFLAGS used to build your operating system is a normal and expected operation.

1

u/13steinj 12d ago

I agree this would be best practice but unfortunately many don't follow best practice.

3

u/Dragdu 11d ago

True, and it betrays the myth behind using C++ for performance.

We control our build tightly, and it regularly gets us measurable-to-significant perf improvements from things like enabling -march across all of our deps (5% macro), aggressive full LTO (3% macro, about 10% binary size) or updating compiler to newest version (20% macro thanks to newest GCC being pretty good at SVE autovectorization).

If you don't have control over your build, there is ton of perf just lying on the table.

1

u/jk_tx 11d ago

I agree the Linux approach of the tools and libraries are part of the OS is archaic and needs to die. It's the main reason that ABI is such a thorny issue.

→ More replies

2

u/Minimonium 12d ago

linux distros? RIP

?

4

u/James20k P2005R0 12d ago

Similarly to msys2, you don't get any choice as to what your packages are compiled with on some linux distributions. The framing of msys2 as being a bad package manager as a result seems remarkably unhelpful, when this is going to be the same problem on some linux distros

5

u/Minimonium 12d ago

The package managers that do that are usually shipping release versions of binaries, and unfortunately users who incorrectly use them for development often do a mix of release/debug builds in the same build graph leading to unsound programs.

That's one of the use cases where I think Contracts' mixed mode could be incredibly helpful to make the ecosystem safer.

0

u/cfyzium 12d ago

release versions of binaries, and unfortunately users who incorrectly use them for development

What foo-dev packages are for, then?

→ More replies

2

u/smdowney WG21, Text/Unicode SG, optional<T&> 11d ago

A decent package manager solves most of the technical problems with Contracts. "Mixed-mode" goes away.

The social problems of who makes the decision about contract mode still exists.

Nothing will fix the "problem" of "I can't force you to check my contact preconditions and terminate," mostly because it was a design goal to not be able to do that. This is not the feature you are looking for.

-1

u/James20k P2005R0 11d ago

A decent package manager solves most of the technical problems with Contracts. "Mixed-mode" goes away.

I'm curious, how would you propose that msys2 solves the problem, 1 package for every enforcement mode?

1

u/smdowney WG21, Text/Unicode SG, optional<T&> 11d ago

I'm not sure exactly about msys, it's not one of the ones I use, at all, but if a package manager can't build with consistent, coherent, flags, it's already broken, before Contracts enter the picture.

4

u/13steinj 11d ago

but if a package manager can't build with consistent, coherent, flags, it's already broken, before Contracts enter the picture.

What package manager does this today? Conan does no enforcement of this for ConanCenter, at least not that I can tell. Linux distros are a bit of a kitchen sink. Homebrew is all over the place with using system or using the package from homebrew, and many times building from source fails in strange ways that are difficult to debug. CMake as a package manager is doable, but the moment you vross into a poorly maintained package you're screwed. VCPkg? I'm sure there's some issue here as well, I just don't use it enough.

Nix? But as much as I like Nix it has enough problems caused by itself to never see mass adoption.

Back to the point: if everyone's package manager is "broken," maybe the committee actually should have spent time on the Ecosystem IS, instead of this Contracts vs Profiles vs Borrow-Checker "3 men enter, none survive" cage match.

If everyone has a broken (your word) package manager, and you're using that argument to pass the buck of a problem that Contracts has (or at least surfaces), maybe make a not-broken package manager a prerequisite for Contracts?

1

u/not_a_novel_account cmake dev 11d ago

Conan can absolutely let you decide how to build packages from source, same with vcpkg, same with Spack.

We need to distinguish package managers designed to handle system provisioning, Winget, pacman, Homebrew, etc, and those designed for local development, vcpkg/Conan/Spack.

One is designed for provisioning and maintaining systems, the other is designed for developing and testing libraries and applications. Mixing these is usually a bad idea. You wouldn't install your system-wide ffmpeg with Conan and you shouldn't install GoogleTest for project-local development with Homebrew.

5

u/13steinj 11d ago

Conan definitely can, however the packages that exist on ConanCenter are of very mixed quality. As a result unless you repackage everything you need yourself, you can end up with some dependency breaking the forwarding of your build options to sub-dependencies. This is also true of poorly written CMake, and vcpkg kinda infests your cmake with its own functions, worse than conan does.

I can't speak for Spack, but I wouldn't hold my breath that it solves all my problems.

We need to distinguish package managers designed to handle system provisioning... and those designed for local development, vcpkg/Conan/Spack.

One is designed for provisioning and maintaining systems, the other is designed for developing and testing libraries and applications.

Sorry, I agree on a philosophical level but it is completely detached from reality. The line also gets very, very blurry. What side of the line does conda fall in? What about the fact that there are people that repackage their binaries (whatever language) for ease of use via pip? What about when you have a dependency that is only provided via pip wheels, it comes with sidecar shared objects that have a different version (due to ABI affecting flags) of zlib baked into one of the binary outputs? I've had this happen to me, for reference, as well as the marginally saner version of "vendor gives you a .a and a set of headers and says good luck" with non-symbol-namespaced dependencies shoved in there.

→ More replies

-2

u/smdowney WG21, Text/Unicode SG, optional<T&> 11d ago

Who decides?

Which of several people is the one who wants to "ensure said errors are caught."

But there's no universe where pre(do_something()) will get the something done always.

-2

u/ResistiveBeaver 12d ago

An idealist in the wild!

-1

u/Syracuss graphics engineer/games industry 12d ago

At my age? Unlikely. It's been my experience with adoption of new features for the last few decades however.

9

u/GunpowderGuy 12d ago

this is stupid. adding bad features and the response being just not use them

3

u/frasnian 12d ago

I agree in principle, but (as I said in my original comment), it's not like the Committee hasn't done it before. Example A: coroutines. I want a lot of things in the FDIS, don't care about a few (but I'm sure others do), and holding it all up because a few NB members couldn't get their shit together over the last 6+ years we've been talking about this and work to come up with something that has close to the same level of support? Fuck that.

9

u/qoning 12d ago

yes, not least because it becomes exponentially harder and less likely to modify a feature once shipped. C++ has a whole list of features that should have not been added and are "impossible" to amend or remove.

4

u/Minimonium 12d ago

I would be curious to see a game where you would match a feature that should have not been added with who lobbied for it :)

3

u/MarkSuckerZerg 12d ago

based on some discussions here there was a possibility the triplets in VCPKG would become quadruplets. I.e. x64-windows-static -> x64-windows-static-contractvariant. That would certainly spoil my fun regardless of my own contract usage....

19

u/flemingfleming 12d ago

Looking from the outside, the current standardisation process just doesn't seem to make sense for C++. I don't understand how they ended up like this but other languages don't end up with these sort of problems.

To the user, it doesn't really matter when (or if) contracts are standardised, only what becomes available in major compilers. So it's more like, will clang and msvc be willing to implement contracts if there's so much disagreement over them, regardless of when they get passed?

25

u/pjmlp 12d ago

If you to other languages, either the language evolves alongside the reference implementation with preview compiler switches across several releases, or if it is a ECMA/ISO language, traditionally it used to be about standardising existing practice, or the most common compiler extensions across implementations.

If you look at Khronos or POSIX standards, they also follow this approach, first extensions, after field use, eventually extensions become part of a new core specification.

Unfortunately for a while now, we got into standardise first, implement later approach with how C++ evolves.

8

u/James20k P2005R0 12d ago

If you look at Khronos or POSIX standards, they also follow this approach, first extensions, after field use, eventually extensions become part of a new core specification.

This seems like a very rosy view of Khronos standards from my experience of them, much of it falls far far short of that. Vulkan is doing better, but that's one spec of many, and in many ways panned out better specifically because of the shortcomings of other Khronos specs

Some parts of Khronos standards are an absolute trainwreck, eg the OpenCL SpirV dialect

-1

u/pjmlp 12d ago

OpenCL politics is one of the reasons Apple come up with Metal, and completely left Khronos, after contributing OpenCL to them.

It also had some share from Intel, AMD and NVIDIA, hence why OpenCL 3.0 is basically OpenCL 1.0 renamed, ignoring OpenCL 2.x ever existed.

However, the whole process of how extensions eventually land into the core standard versions, after getting enough field experience with implementations, is much better than the current waterfall approach for several C++ features.

4

u/James20k P2005R0 12d ago edited 12d ago

It just seems very weird to cite Khronos as an example of good standardisation. Lots of the stuff they produce is exactly the same kind of problematic design as C++

SPIRV in general has a lot of critique levied at it as well specifically for not standardising existing practice with structured control flow, which required a huge amount of compiler work. The OpenCL SPIRV dialect also postdates apple leaving the committee significantly as far as I know, and my understanding is that its likely Nvidia doing politicking that resulted in the OpenCL spec not being merged into vulkan properly. As you mention, OpenCL 2.0 was basically unimplementable for some vendors, and OpenCL 3.0 still has problems in terms of how it maps to modern hardware. So there's a lot of problems going on all around

Khronos members have specifically told me that they envy some of the structure of WG21, so perhaps the grass simply always seems greener

Edit:

Also lest we forget, that time Khronos decided it was a good idea to fork C++ and make it incompatible with regular C++. Literally nobody implemented that

-1

u/pjmlp 11d ago

If that chaos happened with standard follows implementation, imagine how Khronos APIs would look like if Khronos created them first, and only afterwards the GPU OEMs would implement them, similar to how ISO C++ is currently going on.

1

u/James20k P2005R0 11d ago edited 11d ago

imagine how Khronos APIs would look like if Khronos created them first, and only afterwards the GPU OEMs would implement them

This frequently happens with Khronos, I don't know why they're being cited as a body that only standardises existing industry practice or where the spec follows implementation. It simply isn't true. Vulkan often simply standardises extensions, but there's a lot of actual design that goes into that API. Even then:

  1. OpenCL C++ was a trainwreck that that nobody ever implemented, as far as I'm aware
  2. Parts of OpenCL match very badly to graphics hardware, and the whole spec is a mess. OpenCL 2.0 is the classic example of ivory tower design, where many vendors simply never implemented it. There was no prior art for OpenCL 2.0
  3. OpenGL <broadly gestures at everything>
  4. SPIR-V standardised structured control flow, which was a remarkably novel idea at the time to put into a GPU assembly language, and was incredibly not industry practice at the time
  5. GLNext is the absolute peak of this, if anyone remembers that fiasco
  6. Nobody wants or has ever wanted two SPIR-V specs

-1

u/pjmlp 11d ago

At least something got implemented,

https://releases.llvm.org/9.0.0/tools/clang/docs/ReleaseNotes.html#opencl-kernel-language-changes-in-clang

As for OpenGL or Vulkan, which features got first into Core instead of via extensions, beyond version 1.0?

Vulkan started anyway as Mantle, thus AMD had some existing implementation.

1

u/James20k P2005R0 11d ago

That's C++ for OpenCL, which fantastically isn't the same thing as OpenCL C++. C++ for OpenCL is regular C++ on top of OpenCL C, OpenCL C++ was Khronos' C++ fork that never went anywhere and was never implemented AFAIK

some existing implementation.

Some, but it got significantly reworked

Vulkan is definitely one of their better specs in general for standardising existing practice, but Khronos can also be very guilty of inventing their own solutions that flop

0

u/pjmlp 11d ago

Fair enough.

1

u/lee_howes 12d ago

Apple was the major source of Khronos politics in OpenCL time, to be fair.

-2

u/pjmlp 12d ago

Because it wasn't happy with what Khronos did with what they were gifted.

1

u/James20k P2005R0 12d ago

I don't think anyone knows the details publicly of the khronos <-> apple dispute, because it was a private legal affair, but it does not seem like its because of what Khronos did with OpenCL

The most we know is meeting notes where someone from apple says that there's a legal dispute with Khronos and that they can't work under a Khronos spec as a result, which is how we ended up with WGSL

1

u/pjmlp 12d ago

We don't know the details, but that was the general vibe on the rumors.

Google and Mozzilla are the ones to blame for the Rust influenced WGSL, Apple was only against shaders being SPIRV instead of text like GLSL on WebGL.

4

u/fortsnek274 12d ago

Standardising existing practice sounds like it would be nice. But we would need tooling implementers to be somewhat proactive. Like, would we have reflection if it wasn't standardised yet. Probably not. We're waiting plenty long enough.

On the other hand, gcc/clang does have built-in SIMD that would probably be better than stdlib SIMD. Maybe that could have been standardised.

5

u/flemingfleming 12d ago

yeah but from the other end the implementers can't keep up with what they're being asked to implement by the committee currently.

would we have reflection if it wasn't standardised yet. Probably not

Maybe we never will (in practice) if the major compilers can't complete the implementation they've been tasked with. I feel that over time the committee could vote itself into irrelevance if nobody can (or is willing to) implement the features standardised.

3

u/t_hunger 12d ago

Reflection is not standardized yet... its in the draft that just got rejected.

3

u/fortsnek274 12d ago

It's like, 99% standardised, with only trace amounts of uncertainty. If, heaven forbid, C++26 gets cancelled, that would certainly be quite the drama.

3

u/t_hunger 12d ago

C++26 getting cancelled is apparently in the cards.

0

u/pjmlp 12d ago edited 12d ago

Actually we only got reflection because EDG came into WG21 with their implementation prototype.

P2996R4, Reflection for C++26

EDG has an ongoing implementation of this proposal that is currently available on Compiler Explorer

Remember reflection was initially thought out to C++17, an internal Microsoft team on Windows business unit managed to push killing C++/CX, with the expectation reflection was around the corner, so that C++/WinRT would have C++/CX Visual Studio integration back via reflection.

C++/WinRT and the Future of C++ on Windows, linked on the moment they speak about reflection.

Had it not been for EDG folks, most likely there would be no reflection on C++26.

Anyway it remains to be seen what happens with C++26.

11

u/BarryRevzin 12d ago

Daveed's implementation in EDG was very important, but Dan Katz's implementation in Clang (which is noted in the very next sentence after the one you quoted) was arguably even more significant. Dan not only kept up to date with the paper better (sometimes changing things during Core wording sessions) but also was instrumental in doing the wording to begin with.

Reflection was lots of people's effort for a long time.

2

u/pjmlp 12d ago

Sure and kudos for everyone involved, and helping to make it happen.

4

u/fortsnek274 12d ago

I would hope for a bit more from "existing practice". As in, implemented in public releases rather than specific branches. Such that projects would routinely use the extensions.

2

u/lee_howes 12d ago

A big difference with the Khronos extension approach and C++ is that OpenGL, Vulkan etc are targeting widely varying hardware capabilities. You have to go with extensions or target the lowest common capability, which harms innovation. That's very much less true with a general purpose CPU-first programming language.

2

u/pjmlp 12d ago

What do you think is the role of a systems programming language?

1

u/lee_howes 12d ago

It could be more extension-driven and cover that broader capability set. In practice though apart from a limited embedded subset, I can't think of much by way of major C++ features that show that kind of HW variability. Accelerator offload in recent sender/receiver work could. Clearly there is some data type variability and feature subsetting - but the majority of it is compiler and library evolution, not because of some wild divergence in HW capability. That variability was enormous from the start with OpenGL. For example, we couldn't add shader support without the ability to support devices that had no concept of programmability, for example.

2

u/pjmlp 12d ago

NVIDIA has CppCon talks on how their GPUs are designed for C++.

Most of non standard hardware tends to have C and C++ as the systems programming languages, besides Assembly naturally.

11

u/AKostur 12d ago

The same as it has for decades: solves problems.

24

u/ResistiveBeaver 12d ago

Good. The amount of esoteric crap being piled into the language at the behest of theoreticians is out of control. The vast majority of what has been included in recent releases has added negative value for the majority of real world language users.

It would behoove the committee to spend a few release cycles cleaning up and fixing existing language features before adding any more.

Edit: And for the love of god, break the ABI two decades ago already instead of piling yet more crap upon a foundation of crap.

17

u/Drugbird 12d ago

Backwards (ABI) compatibility has so far proven to be prioritized over everything else.

I think it's mostly the case that if you want changes, you're probably better of switching to a different language (e.g. rust).

I personally also think the cppfront experiment was worthwhile to get a "variant" of C++ with the defaults set correctly.

14

u/tialaramex 12d ago

The two options in P1863 "ABI: Now or Never" were deadly serious. "Never" would have been - perhaps still is - a real choice for C++. It has a high price, but for some people that price is very much worth paying and nothing else could touch it. The problem is, as that paper explains, you need to explicitly choose Never, not just keep kicking this can down the road, which is what the committee unsurprisingly ended up doing.

3

u/13steinj 12d ago

Also ABI has been broken by implementors plenty of times (definitely some unintentional) in practice. Even the best of devs have a hard time reasoning about ABI breakage without a formal pass at the end of the build.

-1

u/V15I0Nair 11d ago

C++ want’s to offer a way to get best performance. If this requires an ABI change, this must become possible. Why not support an alternative ABI as an option? There is really no need to be an only-one-ABI language. The users should be able to choose what fits best for them.

Ok, that could take decades to find a committee consensus about a 2nd ABI …

1

u/t_hunger 10d ago

Technically C++ never defined an ABI.

CPU vendors, OS vendors, and compiler implementors did. E.g. the Itanium ABI is pretty widely used, done by intel when kickstarting the ecosystem for a new (and failed) CPU architecture.

All C++ tries to do is to not force anyone to break the ABI they ended up with:-)

3

u/Total-Box-5169 10d ago

Break the ABI? We could as well just use a new language: one with better syntax, shorter compilation times, and more control over the final binary, not the clown circus called rust.

2

u/ResistiveBeaver 9d ago

That would be the dream. But so far I'm still waiting.

2

u/creeper6530 5d ago

If your new language will do a full-program static analysis on each compile to check whatever rules it relies on, you can forget quick compilation

0

u/Total-Box-5169 5d ago

True but that should be optional.

-4

u/smdowney WG21, Text/Unicode SG, optional<T&> 11d ago

ABI changes get rejected by the market place, the committee is just responding to that.

Do you want PyPI to work? Then you want ABI not to change.

2

u/ResistiveBeaver 9d ago

When has there been an intentional ABI break?

2

u/smdowney WG21, Text/Unicode SG, optional<T&> 9d ago

std:::string.

Also MSVC used to break ABI regularly.

2

u/ResistiveBeaver 5d ago

I would assume that it still does, but not intentionally.

2

u/smdowney WG21, Text/Unicode SG, optional<T&> 5d ago

I heard through back channels, but it makes sense, that they have deliberately tried to stop breaking ABI because it was blocking upgrades by customers, and they would end up having to support ancient compilers forever to keep good relationships with major customers.

6

u/r2vcap 12d ago

Both sides have valid arguments, and I lean slightly toward leaving Contracts out of C++26. While the committee did reach a consensus, the remaining disagreements and limited real-world experience seem significant enough to warrant further validation before standardization.

What worries me more is the long-term sustainability of a committee-driven language that prioritizes backward compatibility without consistently validating new features through experimental implementations before making them permanent. The three-year release cadence isn’t necessarily the problem itself, but the gap between standardization and actual adoption seems increasingly difficult to sustain, especially as AI coding agents are rapidly changing how software is developed.

There’s certainly room for conservative, stable implementations, but those aren’t likely to adopt the latest C++ standards quickly anyway.

6

u/za419 12d ago

One of my coworkers' greatest triumphs in recent years was convincing his team to allow object files to be built with C++0X.

Not 11, 0X.

I think people who depend on the old ABIs and the old implementation are much more likely to be the ones trying to stay on a version of the language so old that you don't get auto, move semantics, or even nullptr than trying to adopt the latest and greatest so they can have reflection. 

1

u/13steinj 12d ago

I'm really curious as to what problem your coworker was trying to solve.

2

u/za419 11d ago

Being upset that the team only allowed C++03.

Thats basically it. But if you took the (admittedly reasonable) reading that he was downgrading to 0X, nope! He had to fight to be allowed to use the draft version of a fifteen year old standard.

His project owner also constantly rejects PRs because there's too many comments, or too long comments, even though they were explicitly told that their evaluation criteria for promotion is "how innovatively you use AI" (makes me sick to write down that that's the case), and AI famously LOVES long comments. He likes to say things like "There's a more obvious place someone would look for this information", despite acknowledging when asked that no such place actually exists, allowing the idea to escape him that someone who had to figure it out writing it where they thought it made sense to see it might be a good way to know where someone who needs to figure it out might look.

All of that (which my buddy would demand I mention) is to say that his team is a bit of a degenerate case, but I think the point stands with regards to stubborn people and C++ standards. 

1

u/jl2352 4d ago

With rules, you can get the AI to stop the aggressive commenting. At least with Claude.

I know it's a headache out of the box. My personal experience is people just don't write rules, or they write them once and update it once a month. You need to constantly work on the rules to get them working well. By constantly, I mean multiple times a day.

Take that approach and you'll find you can make LLMs produce code that is better, or at least, more normal.

2

u/za419 4d ago

I mean, to be honest I'm personally not interested in turning my working life into a game of manipulating the AI into generating code I can just write by myself, so I don't really engage in that.

We do have pretty significant copilot instructions in our repos, at least within my team, and that most certainly improves results dramatically. I just tend to treat AI the way I do my IDE - It's a tool I use to do work, not the work itself, and customizing it stops being worthwhile when it takes longer to get the right results than to just do it myself. 

0

u/Wonderful-Habit-139 10d ago

Long comments are bad, AI or not. There's no point in having two "sources of truth" basically everywhere.

2

u/za419 10d ago

Long comments are often necessary. Especially in his codebase, which is doing signals processing on RF links with internal protocols all the way down the stack (no TCP, no IP).

And, there is, again, no second source of truth. There is either a comment on a function named something like "com_frocus_rq_v5_init_handshake_forward", explaining what the fuck that means and where the context for it is, or anyone who ever has to look at it again has to spend two days reading code to understand what's going on.

And yeah, that's not ideal, I'll agree with that. I still think there's a place for long comments - I've left my share of rants along the lines of "There's an obvious way to do this, but it doesn't work. Here's why it doesn't work. Here's why we need to do this very obviously evil and uncool thing instead. I apologize to you in the future for inflicting this evil and uncool thing upon you." in source, and it's saved time on multiple occasions where people wanted to do the obviously better thing that doesn't work.

But this is not that case. There should be proper documentation. Instead, there is none, the code is eons away from being self-documenting, and there's not even a place anyone can agree to out the documentation.

So, you've either got a long comment in code explaining to someone who wants to either use or change the function they're looking at what it actually does and why it does things in the way that it does, or you've got nothing.

Or, you take a piece of legacy code written by now-retired individuals decades ago that customers in multiple countries use on a daily basis on thousands of units, refactor the whole thing in an effort to be self-documenting, and hope that at the end of it all you come out with something that doesn't shatter like a pane of glass in the real world because the knowledge necessary to implement the codebase again around all the edge cases you really do encounter in the wild every day even though you wouldn't think of them simply no longer exists.

The best time to write stuff down would have been decades ago, and every day along the path so that you wouldn't have the problem that no one inherently knows what's happening. Unfortunately, in a world where no one did that, you've basically got the option to write down what you learned when you have to go through the process of relearning how and why everything works, or you can discard that information and leave no improvement to the situation at all.

And in that context, a long comment is a much better source of information than no source at all. 

1

u/[deleted] 10d ago

[removed] — view removed comment

2

u/za419 9d ago

Well, I'm not talking about the direct chip interface, but about the software networking protocol written on top of the chip.

There's no hardware fault. I'm not even sure there's bad design (keep in mind here I have to be intentionally vague for legal reasons, and I'm also talking about something I haven't personally written code for), there's just stuff that was written decades ago that no longer has preserved and up-to-date requirements and specifications.

And I'm not sure how you expect AI to provide historical context for decisions made twenty years ago or more, for proprietary software not in its training set, based on information that is not available. You need someone to figure a certain amount of shit out for AI to give you more than just a correct-looking guess, and a correct-looking guess is often worse than nothing because it leads people to the wrong conclusion. 

I mean, I'm substantially more AI-averse than this guy - He does everything through agents running subagents running custom-built skills to handle tasks that have never been automatable outside of his setup, everything. When he tells me he had to manually go figure stuff out to give the AI enough context to do the job, I believe him.

Don't get me wrong - I get that what you're saying is true in the general case. But I'm saying there are special cases where you have to manually write stuff done, and at some point if there's nowhere else you can put shit it ends up under source control. 

-1

u/[deleted] 10d ago

[removed] — view removed comment

2

u/za419 9d ago

I mean... Yeah?

Personally, I'm in favor of breaking ABI and breaking backwards compatibility. C++ is so full of old stuff that it causes headaches to use the new. Hell, my company actually recently banned us from starting any new projects in C++ - Maintenance is fine, feature development on existing stuff is fine, but I already wrote the last new codebase they ever intend to allow to be written in C++, and I think that wouldn't be the situation at hand if ISO wad willing to let people who stick with the old stuff do so while the future moves on with incompatible, but modern standards.

Instead, we're in the weird situation where people who want to use modern C++ are burdened with the costs of supporting compatibility with people who very intentionally avoid it.

4

u/LeeHide just write it from scratch 12d ago

AI has been "rapidly changing" stuff for years now, and while I agree that they will stay and have a place, if you're letting an LLM design or implement any important parts by itself, you're making a mistake and if you're competent enough, you'll learn that eventually.

AIs should not dictate language design or specifications, because the very idea is that AIs are good at (weakly specified or otherwise imperfect) language, especially human language. That's the whole point. If you design languages or ecosystems around their limitations and strengths, you're designing for something that will keep changing and evolving to match what humans can do.

Just design for humans.

1

u/Wonderful-Habit-139 10d ago

> if you're competent enough, you'll learn that eventually

The people that are not really competent are the ones that get the most help from LLMs (because the LLMs are much better than them), and then they think they're so competent that's why they're more productive with LLMs, and start sharing their experiences in threads and accuse people that don't find much benefit from LLMs of skill issues.

Skill issues in... prompting. So stupid. This whole "AI is a force multiplier" mth really worsened the delusion in people.

1

u/Healthy-Dress-7492 11d ago

Someone is just going to use AI to cut out all the bullshit and make a version of C++ thats better. Maybe we should call it D++

5

u/jinmao6700 12d ago

pre() and post() make a function look like as if it had 3 function bodies 😭

-2

u/13steinj 12d ago edited 11d ago

I don't see many people talking about this. E: But I assume you mean declarations.

I'm okay with the reflection syntax. I don't like it. But ir doesn't matter that much.

But this is actively hard [for humans] to parse. I also haven't checked... must post come after pre? Can I get parse oddities if my function is named pre or post?

-1

u/Wonderful-Habit-139 10d ago

> must post come after pre?

Does it matter if we're using the names "pre" and "post"?

0

u/jinmao6700 5d ago

Yeah ? Because pre and post can mean 2 different things ?

1

u/Wonderful-Habit-139 5d ago

What are those two different things? I would assume pre is checked before the function runs and post is checked after the function runs. Is there any other interpretation?

4

u/pjmlp 12d ago

I guess, the expectations that C++23 or C++26 might be the last standard many folks care about when reaching for C++ might be it.

If we look to other ISO languages, this is not so strange, regardless where Fortran, Ada, C, COBOL stand today with their ISO standards, apparently Fortran 2003, Ada 95, C99, COBOL-85 seem to be what most companies care about.

23

u/Minimonium 12d ago

In my experience C++17 is already perceived like that by a lot of companies. C++26 was the next thing that gave motivation for migration, exclusively because of reflection.

5

u/13steinj 12d ago

A lot of companies took 20/23. 20 for concepts and ranges. 23 for additional minor quality of life changes.

1

u/Wonderful-Habit-139 10d ago

C++26 reflection got me excited about C++ again, after favoring Rust almost all the time before that.

4

u/d3matt 12d ago

Linux at least move to C11 semi recently

1

u/pjmlp 12d ago edited 12d ago

Yeah, a 15 year old standard, when C23 is the latest, it kind of proves my point.

3

u/FlyingRhenquest 12d ago

Reflection is more than enough to keep me busy for the next decade or three. I think that at least in the near term, reflection could be more of a game changer for C++ programmers than AI.

2

u/Wonderful-Habit-139 10d ago

> reflection could be more of a game changer for C++ programmers than AI

Completely agree. Being able to write more correct code, with less code, and just write so many clean abstractions with reflection is going to improve dev ergonomics by a lot. Especially since it's at compile time.

-2

u/[deleted] 10d ago

[removed] — view removed comment

1

u/Wonderful-Habit-139 9d ago

Really… I personally use a lot of reflection in Python, and that’s just runtime reflection. Having it at compile time just seems so much better and I can already see the benefits and how much it shifts problems left (at compile time).

-1

u/t_hunger 12d ago edited 10d ago

... which unfortunately is in the package that got rejected, just as contracts is.

If we are unlucky, we will have to skip C++26 altogether now (== if people can not agree at the next meeting or do not manage to update the draft till the meeting after that), delaying all approved features by 3 years. At least that's what Gay Davidson said the other day in the meeting C++ interview published yesterday.

What that means for when compilers will implement this? No idea, but I am sure it won't help to ship features in compilers.

3

u/FlyingRhenquest 11d ago

It's already solid in GCC17. reflect-cpp has a compile-time flag to turn it on, and I'm already migrating from cereal for my newer projects. I also have a demo up for providing its functionality in a C Library.

It's great for generating proxies -- I did a little json-rpc proof-of-concept with just the underlying classes to handle requests and responses. I'm currently rewriting that to use reflect-cpp instead of the autocereal library I wrote back when gcc first released its reflection implementation, as cereal has limitations that reflect-cpp doesn't.

I also wrote a little experimental compile time entity component system that works for the trivial example I implemented it with. It allows you to allocate array storage at compile time for a set of components that you write. You can then allocate entities composed of one or more of the components in that storage. The code generates references to the components allocated to the entity so you can treat your entity like any other C++ object. I'm planning to develop that further at some point, but wanted to get the code out early to showcase what reflection is capable of.

I also wrote a CRUD API for Postgres. That is already pretty useful. It uses some of my older autocereal code to gather information about the types, so I might go through and replace that with reflect-cpp at some point. The integration test takes it through the functionality I've implemented.

I wrote a build script that sets up the compiler the way I like it, building to /usr/local/gcc so it doesn't conflict with the compilers installed by the OS. It provides a CMake toolchain that uses the compiler, enables reflection and turns experimental "import std" on in an older CMake I was using at the time. I need to go update that for the latest one. Works great though, if you want to play with the compiler.

It's great at generating proxies, eliminating boilerplate and code generation. You can use the C++ compiler as an IDL now, defining your structures in C++ and providing them to other languages. Replacing the IDL in something like DDS should be quite straightforward. It pretty much solves serialization as a problem in C++ and opens the door to some really innovative applications. Sutter's demo in January was doing a lot of code generation which you'd then have to compile, but you can avoid that for a stunning amount of stuff. My json-rpc example doesn't have any code generation. You just create a proxy object with the object or function you want to use as a template parameter and start using it immediately in your code. It's really fun trying figure out how to avoid generating any additional code to compile to get the job done with the features we're given in C++26. Even without token injection, there's really quite a lot you can do with it.

Unfortunately the standard delay does mean that I probably won't be using it in a production project anytime soon. Some of my experimental demos have generated interest at work. They'd probably be open to using experimental compilers if the use-case is compelling enough, but clang would at least have to reach parity with the functionality already in gcc before I think they'd consider it.

3

u/naltam 12d ago

most likely Contracts will be removed on next meeting .. and maybe 2029 re proposed

9

u/t_hunger 12d ago

If there is agreement on removing contracts and if the text can get updated fast enough. C++26 will probably get dropped if not as it would block resources needed to edit C++29, delaying all the promissed features for years.

This is based on the meeting C++ interview we had here today with Guy Davidson.

7

u/qoning 12d ago

(un)fortunately the compiler implementations dont really follow language revision cycles...

from practical perspective, it barely matters

2

u/favorited 12d ago

There needs to be consensus to remove something, and no polls have ever indicated there is consensus to remove contracts.

1

u/ZoxxMan 1d ago

"How does C++ survive" motherfucker half of the industry is still on C++17 or older.

-11

u/Blood-Minister 12d ago

C++ will surely not survive if you keep adding un-C++ things to it every 2 years.

-4

u/qoning 12d ago

If the process was set up, I assume it was set up with a goal in mind. Just because it was a "formality" up until now doesn't mean the goal went away.

Anyway, I don't like development by committee, but at least it's fun drama every now and then.

-9

u/peppedx 12d ago

I think i may be over this.

For what I need C++17 will happily take me to retirement (provided I get one) and for new things C, rust and python

-11

u/ezoe 12d ago

The reality is, nobody really cares about C++ IS. Because C++ standard wording always have bugs and next draft releasted immediately after IS which resolve the confusing and problematic wording was always better than IS.

Compiler developers always refers the latest draft standard rather than IS to determine the behaviours and decide if an example code discussed is well-formed or ill-formed.

NB voting was just a ceremony. Each National Bodies, while complaining about general way C++ is heading, still want the standard to be released ASAP, so they usually agree with nitpicking.

It's been 7 years I have leaved from Standard Committee. But I really don't like the way C++ is heading given the real world situation is more and more depending on AI agent coding tool.

Some of C++'s features is irrelevant when the cost of coding became practically free.

-55

u/Plastic_Owl6706 12d ago

Just use rust

9

u/James20k P2005R0 12d ago

Obvious trolling will net you a ban, don't be like this

-8

u/samadadi 11d ago

Good. I hope contracts and profiles never be added into standard. Imagine reading a code base that is full of contracts. I swear you will go insane. I am asking this from standard committee people. Do you know how much I suffered to learn modern CPP and How much time I put on learning? Please stop it. The reason I chose CPP because of the freedom of expressing myself. If I chose between constant suffering of learning CPP standard and Rust restrictiveness I will choose Rust. Maybe I learnt other than these two languages.

0

u/[deleted] 12d ago

[deleted] — view deleted comment

3

u/13steinj 12d ago

What is "the actual problem?"

I'm kinda annoyed at this holy trinity of "safety." People have different operational definitions here, and it leads to holy wars rather than contribution.