Thursday, April 27, 2023

Bootstrapping

 

Bootstrapping

  • Bootstrapping is widely used in the compilation development.

  • Bootstrapping is used to produce a self-hosting compiler. Self-hosting compiler is a type of compiler that can compile its own source code.

  • Bootstrap compiler is used to compile the compiler and then you can use this compiled compiler to compile everything else as well as future versions of itself.

A compiler can be characterized by three languages:

  1. Source Language

  2. Target Language

  3. Implementation Language

The T- diagram shows a compiler SCIT for Source S, Target T, implemented in I.

Compiler Bootstrapping 1

Follow some steps to produce a new language L for machine A:

1. Create a compiler SCAA for subset, S of the desired language, L using language "A" and that compiler runs on machine A.

Compiler Bootstrapping 3

2. Create a compiler LCSA for language L written in a subset of L.

Compiler Bootstrapping 5

3. Compile LCSA using the compiler SCAA to obtain LCAA. LCAA is a compiler for language L, which runs on machine A and produces code for machine A.

Compiler Bootstrapping 10


Compiler Bootstrapping 11

The process described by the T-diagrams is called bootstrapping

No comments:

Post a Comment