Hacker News new | past | comments | ask | show | jobs | submit login

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




This 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. :-)


How is this different than having bugs in the C compiler used for the language implementation?


Yes, because of the stableness of the C compiler, bigger test audience, etc., compared to a new language under rapid development.


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


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


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




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: