10 ms·
What about bootstrapping by writing an interpreter for language X and then implement a compiler in X? That used to be common practice and has many advantages, s
by JohnStrangeII 7y ago
What about bootstrapping by writing an interpreter for language X and then implement a compiler in X? That used to be common practice and has many advantages, such as easy targeting of new systems.
Maybe with tools like LLVM it has become a bit less common to do all that on your own, but not everybody wants to use LLVM and spitting out your own machine code directly, without even having a bytecode interpreter, still seems like a rather bad idea. Besides loss of retargetability, the generated machine code will never be fast without an IR, because it will basically just allow for peephole optimizations. I know one or two ingenious people who compiled to x86 assembler, because it was considered the fastest option then, and now regret that choice.
- pfdietz 7y agoIt's not a problem that comes up very often. It's only when a language is first invented. After that, you just compile with older versions of the compiler.