Remix.run Logo
kstrauser 5 hours ago

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

kstrauser 3 hours ago | parent [-]

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.

cxr 3 hours ago | parent | next [-]

You have lost the plot, and you are wrong.

wat10000 2 hours ago | parent | prev [-]

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.

kstrauser 2 hours ago | parent [-]

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.

cxr 33 minutes ago | parent | next [-]

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

wat10000 2 hours ago | parent | prev [-]

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.

kstrauser 41 minutes ago | parent [-]

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.