Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This has always racked my brain. Compilers compile code. I imagine that the compiler is coded. So to actually run the code for a compiler, you'd have to compile it.

How was the first compiler compiled?

share|improve this question
It's like understanding recursion, you have to first understand recursion. – Urda Apr 25 '10 at 20:26
up vote 18 down vote accepted

The first compiler was written in assembly for the A-0 programming language in 1952. See Wikipedia for more info.

The first compiler that could compile itself was written for and in Lisp in 1962. This is called a self-hosting or bootstrapping compiler.

share|improve this answer
For a long time, many programs (including compilers) were written directly in machine code or in assembly language. – grawity Apr 25 '10 at 12:48
As a note, gcc has an interesting bootstrap. You compile a minimal gcc with the system compiler, then use this minimal gcc to compile "big" gcc, then use this "big" gcc to compile another "big" gcc so you can confirm the whole thing worked. – Rich Homolka Jun 26 '12 at 22:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .