4 ms·
It's fairly common practice in compilers (for good reason), i.e. the D compiler is now written in D and the Rust compiler is written in Rust etc. I think the fi
by mhh__ 7y ago
It's fairly common practice in compilers (for good reason), i.e. the D compiler is now written in D and the Rust compiler is written in Rust etc. I think the first Haskell compiler was written in Miranda but that's before my time.
You get to test the product without waiting for feedback from the real world and you also end up with a test suite (in effect) for free.
- Jowsey 7y agoHow do compilers compile themselves before the first iteration? This always confused me
- Doxin 7y agoYou compile the next version of the compiler using the previous version. That does mean that the first version of the compiler cannot be written in the target language. Once you've got that working you can write a new compiler in the target language and compile it with the previous compiler. Back in ye olden days the first assembler was written in machine code. The first C compiler was written in assembly, and the first D compiler in turn was written in C.