Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This does make me wonder about something though: is there a crashplan for a compiler? Can a very minimal gcc be written which would be capable of bootstrapping the entire gcc compiler?

It seems like it would be relevant if a new architecture was developed at least.



If a new architecture was developed you could bring up the whole stack by cross-{assembling,compiling} from an already supported target. By doing so you could test the output using a simulator (or actual hardware) and then when the assembler/compiler is stable enough you could then cross-assemble/compile the assembler/compiler and then be self-hosting on the new architecture.


For any practical purposes, it is best to simply use the full complex software stack on another computer to generate binary code meant for that new architecture.

If we'd really need to bootstrap a compiler from scratch, then a possibility would be to hand-code a Forth system, and then find/modify/make an assembler written in forth; then write a compiler for some small language (scheme?) in that assembler, and then from scheme you can easily get to some C compiler that can compile the full GCC.


>Can a very minimal gcc be written which would be capable of bootstrapping the entire gcc compiler?

Yes. In fact, this is how gcc is built - in stages. First stage: build a compiler that can build the compiler. Recompile the compiler with the newly built compiler. Do it again. Repeat until completion. ;)




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

Search: