6 ms·
Sorry, I don't understand. You seem to be saying there's only two versions of the compiler, one written in a foreign language, e.g. C, the other in a subset, e.
by ralph 13y ago
Sorry, I don't understand. You seem to be saying there's only two versions of the compiler, one written in a foreign language, e.g. C, the other in a subset, e.g. Gosub, called G-2. But then there's "whatever is the current version of the language", which suggests to me incremental improvements, e.g. the language develops as experience is gained rather than being fully planned on day one. So doesn't G-2 undergo changes to implement these? You may keep calling it G-2 but there are many (I never said thousands) of versions of it.
- pjmlp 13y agoLets use Go as an example. Now that Go 1.0 release exists and is stable. One could write a Go compiler using Go 1.0. Eventually the compiler will reach a state that it can fully compile Go 1.0. Now replace the C implementation of Go 1.0 by this new compiler and use it to write Go X.Y using only Go 1.0 features. When the need to target a new OS or CPU arises, add a new backend that generates code for the desired target system in the Go 1.0 compiler. Use the cross-compiler to compile itself with the new backend. Copy the binary to the new system, now use the Go 1.0 compiler to compile the Go X.Y version, whatever X and Y are. You don't need to use multiple versions of the language and by keeping the feature set of base compiler small, it makes it easier to write cross-compilers.
- ralph 13y agoThis is flawed AFAICS. It assumes that because 1.0 is fixed in specification that there are no bugs in the implementation. To return to my original point, these smart guys are on the record stating that's why they didn't do a self-hosting compiler; good enough for me. :-)
- pjmlp 13y agoHow is this different than having bugs in the C compiler used for the language implementation?
- ralph 13y agoYes, because of the stableness of the C compiler, bigger test audience, etc., compared to a new language under rapid development.
- pjmlp 13y agoExcept that is a false assumption. Have you ever done multiplaform C development across using OS vendor specific C compilers? There are lots of nice bugs to be found, just check the available bug databases of any C compiler. So this does not make it any better.
- ralph 13y agoYes, C across AIX, Suns, Silicon Graphics, whatever those HP ones were, and others. Platform differences were common, bugs rare because many had been before me and they could always be worked around; I didn't have to fix a C compiler. When writing a compiler the aim is to fix the compiler. This isn't getting us anywhere. We disagree. I value the opinion of that lot given their many decades of experience. I used to have your opinion, based on textbooks. They've made a good point, one I can see has considered thought behind it.
- pjmlp 13y ago> I used to have your opinion, based on textbooks. I do have compiler development experience, but alas as you say this is not getting us anywhere.