Question:
first c compiler?how?
2011-08-22 21:03:38 UTC
what is the language that was used to create the first c compiler?
Five answers:
2011-08-22 21:20:22 UTC
I'm pretty certain Ritchie would have written it in B (yes seriously there was a language called B which preceded C, see: http://en.wikipedia.org/wiki/B_(programming_language) ).



Might want to read up on compiler bootstrapping to get a better idea of how a language's first compilers are written [ eg. Start here: http://en.wikipedia.org/wiki/Bootstrapping_(compilers) ]
cassin
2016-12-10 11:17:44 UTC
First C Compiler
husoski
2011-08-22 22:08:13 UTC
The first C compiler was a modified B compiler, written in B. See:

http://cm.bell-labs.com/who/dmr/chist.html



The B compiler was originally written in PDP-7 assembler language, using a custom cross-assembler running on a GE machine, and then "bootstrapped" by rewriting it in B. That's one of the two primary strategies for getting a compiler started. First, write a minimal version of the compiler in assembler, and debug to produce...



Compiler 1: Written in assembler.



Then write rewrite the compiler in the subset of itself supported by Compiler 1. Compile that to produce...



Compiler 2: Written in the target language, Compiled by Compiler 1.



Finally, use compiler 2 to compile it's own source. The result is:



Compiler 3: Written in the target language, compiled by "itself".



If all was done right, compilers 2 and 3 should be identical. This process is called "bootstrapping". C was written in B, then bootstrapped into C written in C.
2011-08-23 00:46:55 UTC
Unbiased_me scribbled the following:[color=blue]

> Hi There[/color]

[color=blue]

> I recently read in book that the C compiler is written in C. I unable

> to comprehend the concept behind this. How is the compiler design

> started...Where dodoes one start.[/color]



"The C compiler"? There's more than one, you know. Lots of them, in

fact. Some of them are written in C, some aren't.



How does one write a C compiler in C? Generally, by using another C

compiler. That C compiler is usually either compiled in advance, or

written in another language.

It is even possible to compile a C compiler with itself. This process,

which is called bootstrapping, enables additional compiling, where each

successive compilation of the compiler adds more features.

[color=blue]

> I tried Googling for the answer that C is written in C, however the

> web search proved futile.[/color]

[color=blue]

> C # and .net is written in .net...What!, and the list goes on[/color]



Off-topic.

[color=blue]

> Manas Mittal[/color]
Toad
2011-08-22 21:07:46 UTC
Without looking it up I'm guessing Assembly


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...