ITWissen.info - Tech know how online

Bootstrapping

The term bootstrapping is used, among other things, in connection with compiler construction. In theUnix programming environment, compilers are usually written in the C programming language. Even C compilers are written in C. Using the facilities that a language provides to compile itself is the essence of bootstrapping. Considered is the use of bootstrapping to create compilers and move them from one machine to another only by changing the particular back-end.

For bootstrapping purposes, a compiler is characterized by three languages: The source language S that it translates, the target language T for which it generates code, and the implementation language I in which it is written. These three languages are represented analogously to thefigure, which is called a T- diagram because of its shape. Within the following text, the T-diagram will be abbreviated as S(I)T. The three languages can be completely different. For example, a compiler might run on one machine and generate target code for another machine. Such a compiler is often called a cross-compiler.

Basis T-diagram

Basis T-diagram

As an example, let the task be to write a cross-compiler for a new language L in the implementation language S to generate code for machine N; this means it will generate L(S)N . When an existing compiler for S runs on a machine M and generates code for M, it is characterized by S(M)M . When L(S)N is compiled from S(M)M, we obtain a compiler L(M)N, which is a compiler from L to N, running on machine M. This process is shown in the figure by joining the T-diagrams for these compilers.

The compilation of a compiler

The compilation of a compiler

One thing to note when merging T-diagrams is that the implementation language S of the compiler L(S)N must be the same as the source language of the existing compiler S(M)M, and that the target language M of the existing compiler must be the same as implementation language of the translated form L(M)N. A trio of T-diagrams can be understood as one equation:

L(S)N + S(M)M = L(M)N

Informations:
Englisch: Bootstrapping
Updated at: 12.11.2009
#Words: 352
Links: connection, compiler, indium (In), programming language (PL), code
Translations: DE
Sharing:    

All rights reserved DATACOM Buchverlag GmbH © 2024