2

Possible Duplicate:
How was the first compiler written?

I'm asking this as a single question because, essentially what I'm trying to ask is at the bottom how is all of this implemented, here goes:

How was the first C compiler generated, since C compiler is written in C itself then how was the first source of C compiler generated?

Is C written in ASM, how are languages actually designed?, because before we had high level languages the only way to design something was through ASM, even if C is derived from earlier languages, how were they designed? (My clue is ASM)

I'm getting confused as to how does C work down at the bottom. What I'm trying to say is since at the bottom, everything is implemented at the processor by OPcodes. So what my understanding was that C programs are "essentially" translated to Sys Calls which are implemented by the Kernel.

But then how are syscalls implemented? (Do they directly correspond to OPcodes or is there any other layer of abstraction.

Community
  • 1
  • 1
Kartik Anand
  • 4,513
  • 5
  • 41
  • 72
  • +1 I wanted to know this for a long time ago. – Ghasan غسان Jul 15 '12 at 14:31
  • http://programmers.stackexchange.com/questions/76627/what-is-the-history-of-the-c-compiler – P.P Jul 15 '12 at 14:34
  • You're mixing a lot of stuff in there. C is a language. It doesn't "work" at all. You're looking for info on how C _compilers_ work, how assemblers works, and how operating systems work. All these topics are covered by very large volumes of books. – Mat Jul 15 '12 at 14:35
  • 1
    http://en.m.wikipedia.org/wiki/Bootstrapping_%28compilers%29 the chicken egg problem – Samson Jul 15 '12 at 14:38
  • http://cm.bell-labs.com/who/dmr/chist.html gives a brief description of the invention of C, by the inventor. He describes the early compilers and the (short-lived) languages which immediately preceded C. Sys calls are not comparable to opcodes - a syscall is the way for a program to access some kernel/OS service, whereas an opcode is a single CPU instruction. A program can instruct the CPU to do all sorts of things, it only needs to make a syscall when it wants to access resources that the OS protects from regular processes (for example to allocate memory to your process). – Steve Jessop Jul 15 '12 at 15:00
  • Thanks for the feedback and I don't mind the question being closed in just minutes of asking, at least I got what I wanted :) – Kartik Anand Jul 15 '12 at 16:11

1 Answers1

4

How was the first C compiler generated, since C compiler is written in C itself then how was the first source of C compiler generated?

Bootstrapping.

Community
  • 1
  • 1
Matt Ball
  • 354,903
  • 100
  • 647
  • 710