Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well, I'm pretty sure gcc can bootstrap and self-compile, but I don't know if macports is setup for that.

edit: apparently it's not self-compiling, at least not in the way I was thinking.



You need an initial compiler for the boostrapping process.

Obvious question: how did the first C compiler exist, then? Answer: it was implemented in assembly. And the first assembler was written in machine code.


It's been long enough that I can't edit what I wrote, but I forgot my history. The first C compiler was grown by modifying a B compiler that was implemented in B. That B compiler, however, was originally implemented in assembly: http://cm.bell-labs.com/cm/cs/who/dmr/chist.html


It kinda makes you think. If we delete all compilers in the world, there would be no easy way to make new compilers. It also means that your compiler on your PC can trace its heritage back to the first machine coed compiler ever written, like life itself evolving from one generation to the next.


You're basically just saying that if you delete all copies of X software in the world it would be really hard to recreate X software.

Anyway, writing a C-- compiler in x86 ASM isn't really that bad. It'd probably be even easier to run the compiler in an interpreter.


I was thinking of a similar orign-of-life analogy, but unlike life, compilers have sprung up independently of each other many times over. That is, in the early days, it was common to implement everything over again in assembly on a new machine.


Even gcc is not that metacircular. There needs to be some compiler at the bottom of the bootstrapping.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: