Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It's called <a href="http://en.wikipedia.org/wiki/Bootstrapping_%28compilers%29">Bootstrapping</a>, quoting from Wikipedia:</p> <blockquote> <p>If one needs a compiler for language X to obtain a compiler for language X (which is written in language X), how did the first compiler get written? Possible methods to solving this chicken or the egg problem include:</p> </blockquote> <ol> <li>Implementing an interpreter or compiler for language X in language Y. Niklaus Wirth reported that he wrote the first Pascal compiler in Fortran.</li> <li>Another interpreter or compiler for X has already been written in another language Y; this is how Scheme is often bootstrapped.</li> <li>Earlier versions of the compiler were written in a subset of X for which there existed some other compiler; this is how some supersets of Java, Haskell, and the initial Free Pascal compiler are bootstrapped.</li> <li>The compiler for X is cross compiled from another architecture where there exists a compiler for X; this is how compilers for C are usually ported to other platforms. Also this is the method used for Free Pascal after the initial bootstrap.</li> <li>Writing the compiler in X; then hand-compiling it from source (most likely in a non-optimized way) and running that on the code to get an optimized compiler. Donald Knuth used this for his WEB literate programming system.</li> </ol> <p>And if you are interested, <a href="https://github.com/mortdeus/legacy-cc">here</a> is Dennis Richie's first C compiler source.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload