Live data from Hacker News

GCC 16 considering changing default to C++20

inbox.sourceware.org

81–90 of 119 posts

Re: GCC 16 considering changing default to C++20

#81

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.

> 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?

cursing because the old program does not compile anymore No.

Re: GCC 16 considering changing default to C++20

#82

Earlier quoted context omitted.

Read them again a couple more times and it may become clear. The prior post seemed to be claiming that this required any form of a bootstrapping process, when it does not.

This particular compiler does require bootstrapping, and that's obviously what "the compiler" is referring to in that comment. Building your compiler in another language doesn't help at all. In fact, it just makes it worse. Dogfooding C++20 in your compiler that isn't even built in C++ is obviously impossible.

It absolutely does not. There is no part of C++20 that requires the implementing compiler to be written in C++20.

My original point is that you can write a compiler for any language in any language.

Re: GCC 16 considering changing default to C++20

#83

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.

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

Yeah, I think it's because none of the compilers are obligated to support the standard and things get added that never get implemented.

A good example is the C++11 standard garbage collection! It was explicitly optional but afiak no one implemented it.

https://isocpp.org/wiki/faq/cpp11-library#gc-abi

Re: GCC 16 considering changing default to C++20

#84

Earlier quoted context omitted.

This particular compiler does require bootstrapping, and that's obviously what "the compiler" is referring to in that comment. Building your compiler in another language doesn't help at all. In fact, it just makes it worse. Dogfooding C++20 in your compiler that isn't even built in C++ is obviously impossible.

It absolutely does not. There is no part of C++20 that requires the implementing compiler to be written in C++20. My original point is that you can write a compiler for any language in any language.

What is "It absolutely does not" responding to? I didn't say anything about a C++20 compiler needing to be written in C++20.

Re: GCC 16 considering changing default to C++20

#85
post #81

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.

> 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? cursing because the old program does not compile anymore No.

No old programs wouldn't be able to compile anymore with the proposed change

Re: GCC 16 considering changing default to C++20

#87

Earlier quoted context omitted.

It absolutely does not. There is no part of C++20 that requires the implementing compiler to be written in C++20. My original point is that you can write a compiler for any language in any language.

What is "It absolutely does not" responding to? I didn't say anything about a C++20 compiler needing to be written in C++20.

You said:

> This particular compiler does require bootstrapping, and that's obviously what "the compiler" is referring to in that comment.

You have to pick an option: either it requires bootstrapping, or it doesn’t.

As it’s possible to write the C++20 compiler features in C++11 (or whatever GCC or Clang are written in these days), it factually does not require bootstrapping.

Re: GCC 16 considering changing default to C++20

#88

Earlier quoted context omitted.

This particular compiler does require bootstrapping, and that's obviously what "the compiler" is referring to in that comment. Building your compiler in another language doesn't help at all. In fact, it just makes it worse. Dogfooding C++20 in your compiler that isn't even built in C++ is obviously impossible.

It absolutely does not. There is no part of C++20 that requires the implementing compiler to be written in C++20. My original point is that you can write a compiler for any language in any language.

> My original point is that you can write a compiler for any language in any language.

A perfectly fine observation on its own—but it's not on its own. It's situated in a conversational context. And the observation is in no way a counterpoint to the person you posted your ostensible reply to.

Aside from that, you keep saying "bootstrapping" as in whether or not this or that compiler implementation strategy "requires bootstrapping". But writing a compiler in different source language than the target language it's intended to compile and using that to build the final compiler doesn't eliminate bootstrapping. The compiler in that other language is just part of the bootstrapping process.

Re: GCC 16 considering changing default to C++20

#89
post #74
post #68

Earlier quoted context omitted.

well, shouldn't not-up-to-date code use the corresponding compiler flag instead of someone starting a greenfield project, who might then write outdated code?

No? The "corresponding compiler flag" is a new feature. I mean, who told folks at Bell Labs in 1978 how the GCC --std= arguments would work in the coming decades? Legacy code is legacy, it doesn't know it needs to use the correct flags. When it was a greenfield project, it was the default! Like, think about it: if you think the defaults should be good for greenfield projects, then greenfield projects won't be using t…

GCC's default has already changed once (to C++11). It did not cause any significant problems, and any software which is relying on the current value was created long after the flags to pick a standard version were added.

Re: GCC 16 considering changing default to C++20

#90

Earlier quoted context omitted.

What is "It absolutely does not" responding to? I didn't say anything about a C++20 compiler needing to be written in C++20.

You said: > This particular compiler does require bootstrapping, and that's obviously what "the compiler" is referring to in that comment. You have to pick an option: either it requires bootstrapping, or it doesn’t. As it’s possible to write the C++20 compiler features in C++11 (or whatever GCC or Clang are written in these days), it factually does not require bootstrapping.

Here, "requires bootstrapping" means "gcc needs to be able to build with gcc, including older versions of gcc."
Post reply on HN