0% found this document useful (0 votes)
0 views3 pages

Lesson 12 Bootstrapping

The document discusses the concept of bootstrapping in programming languages, specifically how to implement a language using its own implementation. It outlines various possibilities for creating a Pascal compiler for a new processor, including writing directly in machine language, using another language, or implementing a subset of Pascal first. Additionally, it mentions cross-compiling as a method to port Pascal to a new machine, highlighting the complexity of the bootstrapping process with examples of multiple steps involved.

Uploaded by

David Waihenya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views3 pages

Lesson 12 Bootstrapping

The document discusses the concept of bootstrapping in programming languages, specifically how to implement a language using its own implementation. It outlines various possibilities for creating a Pascal compiler for a new processor, including writing directly in machine language, using another language, or implementing a subset of Pascal first. Additionally, it mentions cross-compiling as a method to port Pascal to a new machine, highlighting the complexity of the bootstrapping process with examples of multiple steps involved.

Uploaded by

David Waihenya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

LESSON 12

Bootstrapping

The notion of implementing a language, by means of using (part of) that language’s own
implementation.

Notation: T-diagram

Diagram Purpose:

Example: We wish to have a Pascal compiler for a new Processor, M.

How do we get it ?

Possibility#1:

Write the compiler directly by hand, in machine language? In assembly language ?

Possibility#2:

Write the Pascal compiler in some other language L, that is already implemented on M. Then,
compile the compiler.
But, this will probably involve too much work.

Possibility # 3: First, implement P, a subset of Pascal. Then, write the desired compiler in P, and
compile it.

Step 1:

Now P is implemented.

Another example:

Now, lets suppose we wish to port Pascal to a new machine, M’.

Possibility #1: Same as for M.

Possibility #2: Same as for M.

Possibility #3: Same as for M.

Possibility #4:

Step 1: Same as for M (implement P on M’).

Step 2: Modify the Pascal compiler.

Possibility #5: Don’t use P! Use the implementation of Pascal on M instead.


Step 1:

Step 2:

Note: Possibility #5 is called “cross-compiling”.

Many compilers undergo a long chain of bootstrapping steps. For example, XPL (a dialect of
PL/I), was written first in Algol, then in XPL, and ported to a B5500 and then an IBM 360. Eight
bootstraping steps were required.

You might also like