4 ms·
It used to be the case that a compiler compiled itself to bare metal machine instructions, but now with so many cpu instruction set targets that's no longer the
by okareaman 4y ago
It used to be the case that a compiler compiled itself to bare metal machine instructions, but now with so many cpu instruction set targets that's no longer the case. LLVM uses an intermediate language like an assemby language. Another way to look at it is the TypeScript compiler compiles itself which is written in TypeScript but the intermediate language is JavaScript. V8 handles the translation of JavaScript to machine code, similar to LLVM translating LLVM IR to machine code
- orblivion 4y agoOkay, so we're treating LLVM intermediate language or javascript as if "assembly" in the bare metal days. Makes sense.
- chrisseaton 4y ago> It used to be the case that a compiler compiled itself to bare metal machine instructions, but now with so many cpu instruction set targets that's no longer the case. Tons of compilers emit machine code.
- okareaman 4y agoSure, I didn't say they didn't. Are you refuting what I said and implying that a compiler is not self-hosted if it doesn't compile to machine code?
- chrisseaton 4y ago> I didn't say they didn't You said 'that's no longer the case'. Isn't that the same as saying they don't?
- okareaman 4y agoIn the context of the question, it is no longer the case that a compiler has to compile to machine code to be considered self-hosting. I thought this was clear, but I guess it wasn't