Live data from Hacker News

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

herbsutter.com

231–240 of 437 posts

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

#231

Earlier quoted context omitted.

No. Modules are a failed idea. Really really hard for me to see them becoming mainstream at this point.

No idea if modules themselves are failed or no, but if c++ wants to keep fighting for developer mindshare, it must make something resembling modules work and figure out package management. yes you have CPM, vcpkg and conan, but those are not really standard and there is friction involved in getting it work.

It has the developer mindshare of game engines, games and VFX industry standards, CUDA, SYCL, ROCm, HIP, Khronos APIS, game consoles SDK, HFT, HPC, research labs like CERN, Fermilab,...

Ah, and the two compiler major frameworks that all those C++ wannabe replacements use as their backend.

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

#232

Earlier quoted context omitted.

No idea if modules themselves are failed or no, but if c++ wants to keep fighting for developer mindshare, it must make something resembling modules work and figure out package management. yes you have CPM, vcpkg and conan, but those are not really standard and there is friction involved in getting it work.

Much like contracts--yes, C++ needs something modules-like, but the actual design as standardized is not usable. Once big companies like Google started pulling out of the committee, they lost their connection to reality and now they're standardizing things that either can't be implemented or no one wants as specced.

Usable enough for Office, and the initial proposal was done by Microsoft.

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

#233

std::execution is very interesting, but will be difficult to get started with, as cautioned by Sutter. This HPC Wire article demonstrates how to use standard C++ to benefit from asynchronously parallel computation on both CUDA and MPI: https://www.hpcwire.com/2022/12/05/new-c-sender-library-enab... Overlapping communication and computation has been a common technique for decades in high-performance computing to "hide…

NVidia is the main sponsor of this kind of work, and a few key figures are nowadays on their payroll.

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

#234

If you ask me (and why wouldn't you? :-)...) I really wish the C++ WG would do several things: 1. Standardize a `restrict` keyword and semantics for it (tricky for struct/class fields, but should be done). 2. Uniform Function Call Syntax! That is, make the syntax `obj.f(arg)` mean simply `f(obj, arg)` . That would make my life much easier, both as a user of classes and as their author. In my library authoring work pa…

The C++ WG is like any other open source project, even when it doesn't look like it.

Someone has to bring a written spec to WG21 meetings and push it through.

And like in every open source project that doesn't go the way we like, the work is only done by those that show up.

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

#236

Earlier quoted context omitted.

I wonder if you're fine with const, constexpr and volatile also being things. I mean, "const" really doesn't mean what one would naively think (that's what "constexpr" is actually for) and the semantics of "volatile" are also widely misunderstood.

Nope, not only is C++ const not a constant, C++ constexpr isn't a constant either, and C++ constinit isn't a constant, C++ consteval is closest, but it's only available for functions. const int a = 10; // Just an immutable variable named a constexpr int b = 20; // Still an immutable variable named b static constinit int c = 30; // Now it isn't even immutable For functions const says this function promises it doesn't…

spot on... that difference between evaluation and storage is exactly why C++ is so hard to keep in my head

I thought constexpr was a hard physical constant, but in reality it's a weird hybrid

this visualisation helped me to wrap my head around it - https://vectree.io/c/c-constness-and-evaluation-qualifiers

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

#237
post #11

I am somewhat dismayed that contracts were accepted. It feels like piling on ever more complexity to a language which has already surpassed its complexity budget, and given that the feature comes with its own set of footguns I'm not sure that it is justified. Here's a quote from Bjarne, > So go back about one year, and we could vote about it before it got into the standard, and some of us voted no. Now we have a much…

> I am somewhat dismayed that contracts were accepted. It feels like piling on ever more complexity to a language which has already surpassed its complexity budget, and given that the feature comes with its own set of footguns I'm not sure that it is justified. I don't think this opinion is well informed. Contracts are a killer feature that allows implementing static code analysis that covers error handling and verif…

Contracts aren't for handling errors. That blog post is extremely out of date, and doesn't reflect the current state of contracts

Modern C++ contracts are being sold as being purely for debugging. You can't rely on contracts like an assert to catch problems, which is an intentional part of the design of contracts

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

#238

Earlier quoted context omitted.

> Nobody wanted it. The fact that the C++ standard community has been working on Contracts for nearly a decade is something that by itself automatically refutes your claim. I understand you want to self-promote, but there is no need to do it at the expense of others. I mean, might it be that your implementation sucked?

Late nineties is approaching thirty decades ago; if the C++ committee has now been working on this for nearly a decade, that's fifteen to twenty years of them not working on it. It's quite plausible that contracts simply weren't valued at the time. Also, in my view the committee has been entertaining wider and wider language extensions. In 2016 there was a serious proposal for a graphics API based on (I think) Cairo.…

> Late nineties is approaching thirty decades ago

Boy, this makes me feel old... oh wait :)

(I agree with your point; early 90s vs. mid-10s are two very different worlds, in this context.)

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

#240

I am actually excited for post and pre conditions. I think they are an underused feature in most languages.

Postconditions are in conflict with programmers' love of early returns.

Formally, it doesn't appear to be so (tests can be added to each early return); in practice, encouraging the reorganization of messy early returns would be zero cost developer reeducation.
Post reply on HN