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

The question of if the first C compiler was written in C, how could it be the first C Compiler?

Because to be the first, it has to be bootstrapped in an intermediate host language… You have to get a parser running, then the syntax, then the etc… etc…

( immense plug of the Ahl book here…)

To be the first complier in a language, as was pointed out, long before I was born, the compiler has to compile itself, so before it could compile itself, it had to have other language processing programs creating the parsing, the syntax, the etc…

Porting it to GCC just means that they could compile it with GCC, the big test is to get it to compile itself, on what ever platform that is the target platform, because finally, if it cannot generate object code/machine language in the target machine’s binary, then its not really ported.

Later on, UNIX came with tools to build compilers with, YACC and LEX.

If they got it to produce PDP-7 Code, its not really much of a port, really.



It was a rhetorical question.

It wasn't the first C compiler, it was the first self-hosted C compiler, which is different.




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

Search: