Dennis Ritchie’s first C compiler (c. 1972)
1–10 of 163 posts
Re: Dennis Ritchie’s first C compiler (c. 1972)
#2Re: Dennis Ritchie’s first C compiler (c. 1972)
#3Very interesting. Does anyone have any idea how the C compiler was bootstrapped. Was it first written in B, or was it written in PDP-11 assembler?
Re: Dennis Ritchie’s first C compiler (c. 1972)
#4Re: Dennis Ritchie’s first C compiler (c. 1972)
#5Very interesting. Does anyone have any idea how the C compiler was bootstrapped. Was it first written in B, or was it written in PDP-11 assembler?
- Rewrite B compiler in B (generating threaded code)
- Extend B to a language Ritchie called NB (new B). This compiler generated PDP assembly There is no version of the NB compiler known to exist.
- Continue extending NB until it became the very early versions of C.
You can read the longer version of this history here:
Re: Dennis Ritchie’s first C compiler (c. 1972)
#6Very interesting. Does anyone have any idea how the C compiler was bootstrapped. Was it first written in B, or was it written in PDP-11 assembler?
Re: Dennis Ritchie’s first C compiler (c. 1972)
#7Re: Dennis Ritchie’s first C compiler (c. 1972)
#8Very interesting. Does anyone have any idea how the C compiler was bootstrapped. Was it first written in B, or was it written in PDP-11 assembler?
I think it was written in B as Ritchie extended B for the PDP-11. By that point the B compiler was written in B https://sci-hub.do/10.1145/155360.155580
Re: Dennis Ritchie’s first C compiler (c. 1972)
#9Very interesting. Does anyone have any idea how the C compiler was bootstrapped. Was it first written in B, or was it written in PDP-11 assembler?
Later, the language would be retargeted to the PDP-11 while on the PDP-7. Various changes, like byte-addressed rather than word-addressed memory, led to it morphing into C after it was moved. There was no clear line between B and C -- the language was self-hosting the whole time as it changed from B into C.
Mr. Ritchie wrote a history from his perspective published in 1993. I've mostly just summarized it above. It's available here: https://web.archive.org/web/20150611114355/https://www.bell-...
Re: Dennis Ritchie’s first C compiler (c. 1972)
#10Very interesting. Does anyone have any idea how the C compiler was bootstrapped. Was it first written in B, or was it written in PDP-11 assembler?
It was written in B. And B was written in B. To trace the bootstrap up into the high level, you have to go further back than the PDP-11. To bootstrap B on the PDP-7 and GE-635 machines he had access too, Ritchie wrote the minimum subset required to compile a compiler in B, in a language known as TMG (in the vein of, and a big influence on, Yacc and similar). This minimal bootstrap was then used to compile a B compile…