Live data from Hacker News

C++26 is done: ISO C++ standards meeting Trip Report

herbsutter.com

181–190 of 437 posts

Re: C++26 is done: ISO C++ standards meeting Trip Report

#181

Earlier quoted context omitted.

Clang’s C++2c implementation status page simply says “no” for both reflection and contracts. GCC’s says “yes”. https://clang.llvm.org/cxx_status.html https://gcc.gnu.org/projects/cxx-status.html

That much I'm aware, but that's just about feature availability. I was wondering how far the implementations have progressed internally, despite the features being unavailable.

Clang basically doesn't implement anything regarding reflection right now. There is some support for parsing (https://github.com/llvm/llvm-project/blob/main/clang/test/Pa...) but that's it. There are some open PRs for other parts though.

Re: C++26 is done: ISO C++ standards meeting Trip Report

#182

Earlier quoted context omitted.

That is a way better syntax. I wonder why C++ didn't adopt it.

There's a whole section on that: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p27...

I don't understand its claim of a "self-documentation trap".

I'm surprised the "= void;" wasn't discussed. People liked it immediately in D, and other alternatives were not proposed.

Re: C++26 is done: ISO C++ standards meeting Trip Report

#183

Earlier quoted context omitted.

I don’t understand this “next evolution” approach to language design. It should be done at some point. People can always develop languages with more or less things but piling more things on is just not that useful. It sounds cool in the minds of people that are designing these things but it is just not that useful. Rust is in the same situation of adding endless crap that is just not that useful. Specifically about t…

Many of the recent C++ standards have been focused on expanding and cleaning up its powerful compile-time and metaprogramming capabilities, which it initially inherited by accident decades ago. It is difficult to overstate just how important these features are for high-performance and high-reliability systems software. These features greatly expand the kinds of safety guarantees that are possible to automate and the…

> powerful compile-time and metaprogramming capabilities

While I agree that, generally, compile time metaprogramming is a tremendously powerful tool, the C++ template metaprogramming implementation is hilariously bad.

Why, for example, is printing the source-code text of an enum value so goddamn hard?

Why can I not just loop over the members of a class?

How would I generate debug vis or serialization code with a normal-ish looking function call (spoiler, you can't, see cap'n proto, protobuf, flatbuffers, any automated dearimgui generator)

These things are incredibly basic and C++ just completely shits all over itself when you try to do them with templates

Re: C++26 is done: ISO C++ standards meeting Trip Report

#184

It looks like they didn't even add _BitInt types yet. Adding concepts but not adding _BitInt types sounds insane considering how simple _BitInt types are as a programmer (not sure about implementation but it already works in clang).

Just like restrict never made it.

Someone has to write a proposal, bring it to the various meetings, and getting it to win the features selection election from all parties.

Also WG21 tends to disregard C features that can already be implemented within C++'s type system.

Re: C++26 is done: ISO C++ standards meeting Trip Report

#185
post #7

Biggest open question is whether the small changes to the module system in this standard will actually lead to more widespread adoption

The best thing the C++ WG could do is to spend an entire release cycle working on modules and packaging. It's nice to have new features, but what is really killing C++ is Cargo. I don't think a new generation of developers are going to be inspired to learn a language where you can't simply `cargo add` whatever you need and instead have to go through hell to use a dependency.

It is already there, with vcpkg and conan, alongside cmake.

You cannot cargo add Unreal, LLVM, GCC, CUDA,...

Re: C++26 is done: ISO C++ standards meeting Trip Report

#186
post #27
post #7

Earlier quoted context omitted.

The best thing the C++ WG could do is to spend an entire release cycle working on modules and packaging. It's nice to have new features, but what is really killing C++ is Cargo. I don't think a new generation of developers are going to be inspired to learn a language where you can't simply `cargo add` whatever you need and instead have to go through hell to use a dependency.

I’m still surprised how people ignore Meson. Please test it :) https://mesonbuild.com/ And Mesons awesome dependency handling: https://mesonbuild.com/Dependencies.html https://mesonbuild.com/Using-the-WrapDB.html#using-the-wrapd... https://nibblestew.blogspot.com/2026/02/c-and-c-dependencies... I suffered with Java from Any, Maven and Gradle (the oldest is the the best). After reading about GNU Autotools I was wonder…

It lacks the first party support cmake enjoys.

Re: C++26 is done: ISO C++ standards meeting Trip Report

#187
post #136
post #135

Earlier quoted context omitted.

You're not supposed to distribute the precompiled module file. You are supposed to distribute the source code of the module. Header-only projects are the best to convert to modules because you can put the implementation of a module in a "private module fragment" in that same file and make it invisible to users. That prevents the compile-time bloat many header-only dependencies add. It also avoids distributing a `.cpp…

What I mean is, I have yet to see projects in the wild _use modules at all_.

Plenty of examples on Github, Microsoft has talks on how Office has migrated to modules, and the Vulkan updated tutorials from Khronos, have an optional learning path with modules.

Re: C++26 is done: ISO C++ standards meeting Trip Report

#188

Earlier quoted context omitted.

I don’t understand this “next evolution” approach to language design. It should be done at some point. People can always develop languages with more or less things but piling more things on is just not that useful. It sounds cool in the minds of people that are designing these things but it is just not that useful. Rust is in the same situation of adding endless crap that is just not that useful. Specifically about t…

Many of the recent C++ standards have been focused on expanding and cleaning up its powerful compile-time and metaprogramming capabilities, which it initially inherited by accident decades ago. It is difficult to overstate just how important these features are for high-performance and high-reliability systems software. These features greatly expand the kinds of safety guarantees that are possible to automate and the…

> One of the biggest knocks against Rust as a systems programming language is that it has weak compile-time and metaprogramming capabilities compared to Zig and C++.

Aren’t Rust macros more powerful than C++ template metaprogramming in practice?

Re: C++26 is done: ISO C++ standards meeting Trip Report

#189

Earlier quoted context omitted.

Input. You are passing in a memory location that can be read or written too. That’s it.

A pointer doesn't necessarily point to memory.

A nitpick to your nitpick: they said "memory location". And yes, a pointer always points to a memory location. Notwithstanding that each particular region of memory locations could be mapped either to real physical memory or any other assortment of hardware.

Re: C++26 is done: ISO C++ standards meeting Trip Report

#190

Earlier quoted context omitted.

Many of the recent C++ standards have been focused on expanding and cleaning up its powerful compile-time and metaprogramming capabilities, which it initially inherited by accident decades ago. It is difficult to overstate just how important these features are for high-performance and high-reliability systems software. These features greatly expand the kinds of safety guarantees that are possible to automate and the…

> powerful compile-time and metaprogramming capabilities While I agree that, generally, compile time metaprogramming is a tremendously powerful tool, the C++ template metaprogramming implementation is hilariously bad. Why, for example, is printing the source-code text of an enum value so goddamn hard? Why can I not just loop over the members of a class? How would I generate debug vis or serialization code with a norm…

Did you read the article? This is called reflection, and is exactly what C++26 introduces.
Post reply on HN