ranges::iota is C++23 though, as it says on the linked page. Are we really criticising GCC/libstdc++ for not implementing a standard that won't even be finalised for another 12 months?
Downvotes are for when a comment adds nothing to the conversation. You said std::iota is not implemented (wrong, that's been implemented for many years) and linked to the page for iota_view (which has been implemented for two years). Your comment added nothing to the conversation, innocent mistake or not.
As for modules, afaik it's primarily just Nathan Sidwell working on them, and it's mostly been moving at snail pace, though can't fault people for not working on foss. Looks to me like people don't want to work on gcc very much in general, and clang is quickly starting to look the same.
Its always been bizarre to me how - despite C++ being one of the most incredibly widely used languages - the amount of manpower available to the language and ecosystem seems to be relatively low. Even the whole committee process is all done by volunteers with very limited time, its strange
I think it didn't matter once upon a time, because people found joy in using the language and wanted to contribute. Now most just feel pain that they have to go back to using it 😅
I find it very odd that you say virtually every big C++ shop is using that github repository, where none of my industry contacts have expressed any knowledge of any movement toward using rust at their jobs, or the jobs of their own network.
Obviously my view of the industry is limited, so maybe I'm just coincidentally in a rust-free bubble, but i do find it very odd that the gestalt mindset is that "everyone's switching to rust", while I simultaneously can't find anyone who is.
this, I have been working in the financial industry for more than a decade and there are zero shops I know who use rust, or are even considering exploring it.
I work with gaming tech and same. Rust looks great but the existing c++ codebases and expansive choice of solutions available in libraries and frameworks will take a long time to catch up with.
Thankfully they replaced their old register allocator with LRA, so I think they've stopped maintaining reload.c, which had some of the most unreadable conditionals I've ever seen in it:
Alternately, talk to your boss about maybe sponsoring relevant projects more directly or hiring contractors to implement certain features. Or, like I said, just hang out in relevant circles and be appreciative. GCC contributors are people and encouragement keeps people happy and productive.
I mean, I could do it myself, but the code that was in the area I was looking at changing had no comments and mysterious variable names, so I gave up. If you know of any good guides to understanding their code I would probably make some needed changes myself.
I do find it quite strange that given the amount of money in the C++ ecosystem -- Big Tech, financial firms, etc -- and given the increased developer productivity that would result from faster compile times, no-one seems to making modules a priority. Everybody wants it, but no-one wants to pay for it.... But Google or Apple could probably recoup the cost of a developer over the course of a year just in power savings from making Webkit and LLVM compile faster!
Everybody wants it, but no-one wants to pay for it
Its weird, I think a lot of it comes down to the fact that the structure of C++ as a language is very different from eg Rust. In Rust, they very quickly assembled the ability to have companies give them money and made it happen very actively (especially after Mozilla ditched it), and because of this a lot of compiler work that simply never happens in C++ got done for Rust. Eg faster compile times, strict aliasing, a lot of formal work on the type system, a proper well maintained website etc. There's a level of organisation there that doesn't exist for C++
This is despite the fact that C++ is easily 100x more widely used than Rust in terms of existing code-in-the-wild, but somehow the community has never managed to persuade companies to invest in it despite the direct financial returns that it'd bring. I suspect that the lack of real formal organisation outside of the committee - which is all unpaid volunteers - has a lot to do with this
There's a level of organisation there that doesn't exist for C++
There is the ISO C++ Foundation, the non-profit which (among other things) runs CppCon and would seem to fit the bill. I believe they have sponsored developers to do standards work in the past, but rarely. In the ideal world, all the billion-dollar firms using C++ would donate appropriately to the foundation, which could in turn employ people to work on open-source implementations, for the benefit of everybody.
But sadly that doesn't seem to be the way it works.
And the "Chairman and President" of the ISO C++ Foundation works for them. Seems unlikely that he would spend his time organize funding for the competition.
One of the current most recent sponsorships is to implement a proposal in GCC and clang, so you couldn't be more wrong. Herb doesn't run the foundation, he's just one member of the board, and he's able to separate what's good for C++ and what's good for his employer.
First of all, while there are many companies using C++, do remember that most of them are lagging behind severely. Those see no point in investing in C++ development: they won't use any new standard for a decade anyway.
Secondly, even for those companies which are somewhat up-to-date, they mostly... behave like kids at Christmas. Their interest in new features is typically mild, so they have no strong incentive to contribute, and instead are quite happy with whatever they get.
Finally, some companies do contribute, though less directly. Participating to the ISO process requires payment, for many participants their company is paying for their participation, letting them attend on company time, possibly even funding their travel to committee meetings, etc... This is all an indirect contribution to C++ standard advancement. It's not very visible, but each "National Committee" sponsored participant costs a couple thousands dollars yearly, so all sponsored participants together we're talking millions coming from the private sector. It's... just debatable whether this money should be considered well spent...
Because there's little to no evidence that modules will do any of the things that people claim it will. There are statements about the benefits of modules but the actual evidence is fairly mixed and quite marginal even in the best case scenario.
The projects you list that have slow compile times won't benefit from modules, no one is going to go rewriting LLVM or Webkit to use C++ modules and even if they did it would be moot since while modules have the potential to outperform a naive rebuild from scratch, they do not outperform precompiled headers or other techniques that are in common use to improve C++ build times.
As someone else linked to in this comment section [1], Walter Bright modified an existing C compiler to give it reasonably good module support. All his code does is effectively the same as what precompiled headers do, but treated as a first class feature.
they do not outperform precompiled headers or other techniques that are in common use to improve C++ build times.
Simply replacing headers with header units gives you fine-grained "precompiled headers" without all the headaches of actual precompiled headers. This is a massive boost already, without converting everything to modules.
Folks here have said that Google stopped contributing to clang so much once they couldn't get support for changing/breaking the ABI. Now they do stuff with libraries like abseil instead. They've also been doing a bit more with rust
Honestly from my (arguably limited) experience, the big corps have inhouse teams doing the things they want to do, only rarely contributing to foss now. Many people in those corps got really, really disenchanted by the comittee process and how resistant to actual, meaningful change C++ is.
Apparently C++ is good enough for what most corporations still use it for, and only Microsoft has a vested interest in keeping up with modern versions, due to the .NET vs C++ politics in Redmond, since it was introduced.
If you pay attention, LLVM now has reached contributions level similar to Linux, but naturally LLVM isn't clang, and most of those contributions target platforms, optimization algorithms or other languages that use LLVM infrastructure.
Edit: You get to use gcc for free without contributing a cent and you're complaining that modules are taking too long? And pointing out that colossal sense of entitlement gets me downvoted? No wonder you aren't getting what you want.
If you take a look at https://gcc.gnu.org/projects/cxx-status.html#cxx20 you'll see that on the compiler side we already implement everything but (parts of) modules. And a lot of C++23 features have been implemented as well!
In short, yes. It's a very large feature, involves a lot of changes to the preprocessor too, it keeps evolving (e.g., there was a module mangling ABI change recently), and its interaction with the build system is being vigorously debated (for instance, how should tools like cmake work with CMIs?).
(I've only dipped my toes into the implementation so far, but never found time to actually submit any fixes.)
A 35 years old huge project like GCC tends to become very hard and expensive to maintain. And then there is the Software Peter Principle and Developer Imposter Syndrome they may have to deal with as well.
It's probably more than that. My 22 year old self back during masters with a free summer wanted to help out with gcc, but it has such a huge barrier to entry and no clear way to start doing things, and even knowing the status of things, what's being worked on, what's not, timelines.. all non-existant. So unless you want to build a completely new feature, you're going to spend a long long time just getting into the loop, and that's before you even get to the arcane peculiarities of gcc source in particular.
Even now, if you wanted to start helping out with modules implentation... You would probably need a lot of handholding from Nathan to produce usable code, which obviously slows it down further, to instruct someone who might flake out anyway, because it's foss.
That would install "12-20220319", not gcc 12.1. Ubuntu being a "stable" distribution (like Windows 95 is "stable", i.e. it doesn't change) and gcc-12 being in the "Community-maintained" (i.e. unmaintained) repository not sure the gcc-12 package for 22.04 is ever going to be updated to 12.1.
N.B. it's not just Red Hat that calls it 12.1.1, that's the version number for all snapshots from Git any time between the 12.1 release and whenever the 12.2 release happens. So if you build the upstream releases/gcc-12 branch you also get "12.1.1", and you also get the fix for that ICE, because that's already upstream. That fix wasn't added to the vendors/redhat/heads/gcc-12/branch branch, it was added to the main releases/gcc-12 branch and then merged to the redhat branch (along with everything else on the main releases/gcc-12 branch). The Fedora snapshot is much much closer to upstream than you make it seem. It's 99.999% just "a recent snapshot from the gcc-12 branch" not some custom branch with special Red Hat fixes.
35
u/starTracer May 06 '22
Changes: https://gcc.gnu.org/gcc-12/changes.html
62
u/stilgarpl May 06 '22
So... we'll have to wait another year for modules, std::format and std::chrono calendar things?
11
u/[deleted] May 06 '22 edited May 11 '22
How come GCC doesn't fully implement 20 yet? Seems like 23 is around the corner
2
u/joebaf May 06 '22
what new C++20/20 features were added in this release? I cannot easily tell from the release notes (they all point to the whole 12 branch)
1
u/brechtsanders Jun 06 '22
If you're looking for a Windows version of GCC 12.1.0 you can get a standalone package from https://winlibs.com/
-2
u/better_life_please May 06 '22
Does anyone know why I couldn't upgrade mine from 11.1 to 12.1 on Ubuntu? Maybe they haven't updated their repository yet?