| ▲ | GCC 16 considering changing default to C++20(inbox.sourceware.org) |
| 54 points by pjmlp 3 hours ago | 52 comments |
| |
|
| ▲ | withzombies 2 hours ago | parent | next [-] |
| Shouldn't the compilers be on the bleeding edge of the standards? What is the downside of switching to the newest standard when it's properly supported? It's the type of dog fooding they should be doing! It's one reason why people care so much about self-hosted compilers, it's a demonstration of maturity of the language/compiler. |
| |
| ▲ | dagmx 4 minutes ago | parent | next [-] | | This is about changing the default. The issue with defaults is that people have projects that implicitly expect the default to be static. So when the default changes, many projects break. This is maybe fine if it’s your own project but when it’s a few dependencies deep, it becomes more of an issue to fix. | |
| ▲ | cogman10 an hour ago | parent | prev | next [-] | | There's a bootstrapping process that has to happen to compile the compiler. Moving up the language standard chain requires that compilers compiling the compiler need to also migrate up the chain. So you can never be perfectly bleeding edge as it'd keep you from being able to build your compiler with an older compiler that doesn't support those bleeding edge features. Imagine, for example, that you are debian and you want to prep for the next stable version. It's reasonable that for the next release you'd bootstrap with the prior releases toolset. That allows you to have a stable starting point. | | |
| ▲ | stabbles an hour ago | parent | next [-] | | This is not the case. They are discussing the default value of `g++ -std=...`. That does not complicate bootstrapping as long as the C++ sources of GCC are compatible with older and newer versions of the C++ standard. | | |
| ▲ | cogman10 an hour ago | parent [-] | | > as long as the C++ sources of GCC are compatible with older and newer versions of the C++ standard. I've worked on a number of pretty large projects. If the target for the source code changes it can be really hard to keep C++20 features from creeping in. It means that you either need to explicitly build targeting 11, or whoever does code reviews needs to have encyclopedic knowledge of whether or not a change leaked in a future feature. It is "doable" but why would you do it when you can simply keep the compiler targeting 11 and let it do the code review for you. | | |
| ▲ | quietbritishjim 32 minutes ago | parent [-] | | > ... why would you do it when you can simply keep the compiler targeting 11 ... It doesn't appear to me that the parent comment was implying otherwise. The default is changing for any compilation that doesn't explicitly specify a standard version. I would have thought that the build process for a compiler is likely careful enough that it does explicitly specify a version. | | |
| ▲ | cogman10 17 minutes ago | parent [-] | | > It's the type of dog fooding they should be doing! It's one reason why people care so much about self-hosted compilers, it's a demonstration of maturity of the language/compiler. I could be misreading this, but unless they have a different understanding of what it means to dog fooding than I do then it seems like the proposal is to use C++20 features in the compiler bootstraping. | | |
| ▲ | ziotom78 8 minutes ago | parent [-] | | I believe they are really referring to the default mode used by GCC when no standard is explicitly stated. The email mentions that the last time they changed it was 5 years ago in GCC 11, and the link <https://gcc.gnu.org/projects/cxx-status.html#cxx17> indeed says > C++17 mode is the default since GCC 11; it can be explicitly selected with the -std=c++17 command-line flag, or -std=gnu++17 to enable GNU extensions as well. which does not imply a change in an obscure feature (bootstrapping) that would only affect a few users. |
|
|
|
| |
| ▲ | kstrauser an hour ago | parent | prev | next [-] | | Counterpoint: you could write a C++ compiler in a non-C/C++ language such that the compiler’s implementation language doesn’t even have the notion of C++20. A compiler is perfectly capable of compiling programs which use features that its own source does not. | | |
| ▲ | cxr 38 minutes ago | parent [-] | | That's not a counterpoint—at least not to anything in the comment that you're (nominally) "responding" to. So why has it been posted it as a reply, and why label it a counterpoint? |
| |
| ▲ | rmu09 an hour ago | parent | prev [-] | | Aren't they talking about the c++ dialect the compiler expects without any further -std=... arguments? How does that affect the bootstrapping process? This https://gcc.gnu.org/codingconventions.html should define what C/C++ standard is acceptable in the GCC. | | |
| ▲ | cogman10 an hour ago | parent [-] | | The way I read withzombies's comment (and it could be wrong) was they were talking about the language version of the compilers source. I assumed that from the "dogfooding" portion of the comment. |
|
| |
| ▲ | binary132 8 minutes ago | parent | prev | next [-] | | A lot of software, and thus build automation, will break due to certain features that become warnings or outright errors in new versions of C++. It may or may not be a lot of work to change that, and it may or may not even be possible in some cases. We would all like there to be unlimited developer time, but in real life software needs a maintainer. | |
| ▲ | unclad5968 2 hours ago | parent | prev | next [-] | | Well there are still some c++20 items that aren't fully supported, at least according to cppref. https://en.cppreference.com/w/cpp/compiler_support/20.html | |
| ▲ | andsoitis an hour ago | parent | prev | next [-] | | > Shouldn't the compilers be on the bleeding edge of the standards? What is the downside of switching to the newest standard when it's properly supported? C++ standards support and why C++23 and C++26 are not the default: https://gcc.gnu.org/projects/cxx-status.html | |
| ▲ | 1718627440 an hour ago | parent | prev | next [-] | | > What is the downside of switching to the newest standard when it's properly supported? They are discussing in this email thread whether it is already properly supported. > It's one reason why people care so much about self-hosted compilers For self-hosting and bootstrapping you want the compiler to be compilable with an old version as possible. | |
| ▲ | superkuh an hour ago | parent | prev | next [-] | | When a language changes significantly faster than release cycles (ie, rust being a different compiler every 3 months) it means that distros cannot self-host if they use rust code in their software. ie, with Debian's Apt now having rust code, and Debian's release cycle being 4 years for LTS, Debian's shipped rustc won't be able to compile Apt since nearly all rust devs are bleeding edge targeters. The entire language culture is built around this rapid improvement. I love that C++ has a long enough time between changing targets to actually be useful and that it's culture is about stability and usefulness for users trying to compile things rather than just dev-side improvements uber alles. | | |
| ▲ | mustache_kimono 3 minutes ago | parent [-] | | > it means that distros cannot self-host if they use rust code in their software. This is nonsense. Debian does in fact build rustc? What's keeping Debian from using the previously verified toolchain to build a newer version? > Debian's shipped rustc won't be able to compile Apt since nearly all rust devs are bleeding edge targeters. More nonsense. Apt devs can target a release and that release can be the release that ships with the OS? |
| |
| ▲ | ajross an hour ago | parent | prev [-] | | > What is the downside of switching to the newest standard when it's properly supported? Backwards compatibility. Not all legal old syntax is necessarily legal new syntax[1], so there is the possibility that perfectly valid C++11 code exists in the wild that won't build with a new gcc. [1] The big one is obviously new keywords[2]. In older C++, it's legal to have a variable named "requires" or "consteval", and now it's not. Obviously these aren't huge problems, but compatibility is important for legacy code, and there is a lot of legacy C++. [2] Something where C++ and C standards writers have diverged in philosophy. C++ makes breaking changes all the time, where C really doesn't (new keywords are added in an underscored namespace and you have to use new headers to expose them with the official syntax). You can build a 1978 K&R program with "cc" at the command line of a freshly installed Debian Unstable in 2025 and it works[3], which is pretty amazing. [3] Well, as long as it worked on a VAX. PDP-11 code is obviously likely to break due to word size issues. |
|
|
| ▲ | dmix 2 hours ago | parent | prev | next [-] |
| That anime gating is very jarring, thought I clicked on the wrong link and clicked back. |
| |
| ▲ | f1refly 2 hours ago | parent | next [-] | | Right? I hope it never goes away, we should make the web more fun instead of sad and clean! | | |
| ▲ | suby 2 hours ago | parent [-] | | I think if you were to poll people, a significant portion would be repulsed by this catgirl aesthetic, or (though this isn't the case for Anubis) the cliche inappropriately dressed inappropriately young anime characters dawned as mascots in an ever increasing number of projects. People can do whatever they want with their projects, but I feel like the people who like this crap perhaps don't understand how repulsive it is to a large number of people. Personally it creeps me out. | | |
| ▲ | ikamm 2 hours ago | parent | next [-] | | I'm not repulsed by it but I do wish the people that forced this stuff into their software/hardware realized how juvenile it makes their product look. There's a decent cheap Chinese pair of Bluetooth earbuds on Amazon that's been very popular among audiophiles but the feedback sounds are an anime girl making noises and there's no way to turn it off so I lost interest in purchasing them. | |
| ▲ | windward an hour ago | parent | prev | next [-] | | The internet was better when it repulsed a significant portion of people. | |
| ▲ | thoroughburro 2 hours ago | parent | prev | next [-] | | > inappropriately dressed How do you think Anubis should dress? | | | |
| ▲ | sacado2 an hour ago | parent | prev | next [-] | | What? She's wearing a hoodie and a tee-shirt, how is that inappropriate? And how being young is inappropriate? | |
| ▲ | exe34 an hour ago | parent | prev | next [-] | | It sounds like something you might benefit from talking to a therapist. It's not normal to have such a strong reaction. I hope you can get the help you need! | |
| ▲ | secondcoming an hour ago | parent | prev [-] | | The whole Japanese cartoon schoolgirl thing is 100% creepy. |
|
| |
| ▲ | NegativeK 2 hours ago | parent | prev | next [-] | | Anubis has been around for almost a year now, but it's also not particularly relevant to the content of the email thread. | | |
| ▲ | veltas 2 hours ago | parent | next [-] | | It's particularly jarring to basically every site I've seen it on which is usually some serious and professional looking open source site. I wonder why nobody configures this, is this not something that they can configure themselves to a more relevant image, like the GCC logo or something? | | | |
| ▲ | 1718627440 2 hours ago | parent | prev [-] | | Anubis is a bit annoying over crappy internet connections, especially in front of a webpage that would work quite well in this case otherwise, but it still performs way better than Cloudflare in this regard. |
| |
| ▲ | wyldfire an hour ago | parent | prev | next [-] | | Recently, on HN: https://news.ycombinator.com/item?id=44962529 | |
| ▲ | 1718627440 an hour ago | parent | prev | next [-] | | I wouldn't have known that this is anime, if not for all the HN comments pointing that out. | |
| ▲ | superkuh an hour ago | parent | prev | next [-] | | Anubis is significantly less jarring than cloudflare blocks preventing any access at all. At least Anubis lets me read the content of pages. Cloudflare is so bleeding edge and commercial they do not care about broad brower support (because it doesn't matter for commercial/sales). But for websites you actually want everyone to be able to load anubis is by far the best. That said, more on topic, I am really glad that C++ actually considers the implications of switching default targets and only does this every 5 years. That's a decent amount of time and longer than most distros release cycles. When a language changes significantly faster than release cycles (ie, rustc being a different compiler every 3 months) it means that distros cannot self-host if they use rust code in their software. ie, with Apt now having rust code, and Debian's release cycle being 4 years for LTS, debian's shipped rustc won't be able to compile Apt. | |
| ▲ | MangoToupe an hour ago | parent | prev | next [-] | | Who cares tbh | |
| ▲ | falcor84 an hour ago | parent | prev | next [-] | | See also discussion on https://news.ycombinator.com/item?id=44962529 | |
| ▲ | tr45872267 an hour ago | parent | prev [-] | | Many people have said they don't like it, and all that did is make its supporters even happier that it's there, because it makes them feel special is some strange way. |
|
|
| ▲ | jjmarr 2 hours ago | parent | prev | next [-] |
| Good. Let me use modules! |
| |
|
| ▲ | secondcoming an hour ago | parent | prev [-] |
| The coroutine convo is interesting. Does it mean that for example, a GCC program may not run correctly when linked to a clang binary and both use coroutines? |