Everything about Self-hosting totally explained
Self-hosting refers to the use of a
computer program as part of the
toolchain or
operating system that produces new versions of that same program—for example, a
compiler that can compile its own
source code. Self-hosting software is commonplace on
personal computers and larger systems. Other programs that are typically self-hosting include
kernels,
assemblers, and
shells.
If a system is so new that no software has been written for it, then software is developed on another self-hosting system and placed on a
storage device that the new system can read. Development continues this way until the new system can reliably host its own development. Development of the
Linux operating system, for example, was initially hosted on a
Minix system. Writing new software development tools "from the metal" (that is, without using another host system) is rare and in many cases impossible.
Several
programming languages are self-hosting, in the sense that a compiler for the language, written in the same language, is available. The first compiler for a new programming language can be written in another language (in rare cases,
machine language) or produced using
bootstrapping. Self-hosting languages include
Lisp,
Forth,
Pascal,
Delphi,
C,
Modula-2,
Oberon,
Smalltalk,
OCaml, and
FreeBASIC.
History
The first self-hosting compiler (excluding assemblers) was written for
Lisp by Hart and Levin at MIT in
1962. Because Lisp interpreters existed previously, but no Lisp compilers, they used an original method to compile their compiler. The compiler, like any other Lisp program, could be run in a Lisp interpreter. So they simply ran the compiler in the interpreter, giving it
its own source code to compile.
This technique is only possible when an interpreter already exists for the very same language that's to be compiled. It borrows directly from the notion of running a program on itself as input, which is also used in various proofs in
theoretical computer science, such as the proof that the
halting problem is undecidable.
Further Information
Get more info on 'Self-hosting'.
|
External Link Exchanges
Do you know how hard it is to get a link from a large encyclopaedia? Well we're different and will prove it. To get a link from us just add the following HTML to your site on a relevant page:
<a href="http://self-hosting.totallyexplained.com">Self-hosting Totally Explained</a>
Then simply click through this link from your web page. Our crawlers will verify your link, extract the title of your web page and instantly add a link back to it. If you like you can remove the words Totally Explained and embed the link in article text.
As long as your link remains in place, we'll keep our link to you right here. Please play fair - our crawlers are watching. Your site must be closely related to this one's topic. Any kind of spamming, dubious practises or removing the link will result in your link from us being dropped and, potentially, your whole site being banned. |