Hacker News new | ask | show | jobs
by okareaman 1520 days 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
2 comments

Okay, so we're treating LLVM intermediate language or javascript as if "assembly" in the bare metal days. Makes sense.
> 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.

Sure, 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?
> 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?

In 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