3 ms·
> Nope, you probably don't do that. You use a computer (host) where you already have a C compiler, and you compile the new compiler (which you wrote/ported). Th
by stingraycharles 14y ago
> Nope, you probably don't do that. You use a computer (host) where you already have a C compiler, and you compile the new compiler (which you wrote/ported). Then you run this new compiler, on the host, to generate executable code for the new architecture (target), i.e. cross-compile. You can use this cross-compiler to (again) compile your ported compiler, but to run on the target architecture. You end up with a native compiler for your new architecture.
Ah, yes, I tried to explain exactly that in the last paragraph I wrote. Is what you're describing different from what I described there?
- ambrop7 14y agoSorry, I missed that, was distracted by your not-really-correct statement above :)
- stingraycharles 14y agoMy mistake. I was trying to illustrate the more theoretical problem of bootstrapping a compiler without a compiler, since I personally find that fascinating. These problems were really solved years ago, and their only place nowadays is in an educational context.