Bootstrapping - PowerPoint PPT Presentation

About This Presentation
Title:

Bootstrapping

Description:

The notion of implementing a language, by means of using (part of) that ... Example: We wish to have a Pascual compiler for a new Processor, M. How do we get it ? ... – PowerPoint PPT presentation

Number of Views:3710
Avg rating:3.0/5.0
Slides: 13
Provided by: manuelb9
Learn more at: https://www.cise.ufl.edu
Category:

less

Transcript and Presenter's Notes

Title: Bootstrapping


1
Bootstrapping
Programming Language Translators
  • Prepared by
  • Manuel E. Bermúdez, Ph.D.
  • Associate Professor
  • University of Florida

2
Bootstrapping
  • The notion of implementing a language, by means
    of using (part of) that languages own
    implementation.
  • Notation T-diagram

Source
Target
Language Written in
3
Bootstrapping
  • Diagram Purpose

APPLICATION
APPLICATION
C
C
M
M
M
Object Coincides
Source Coincides
Execution
4
Bootstrapping
  • Example We wish to have a Pascual 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 ?
    ?

P
M
M
5
Bootstrapping
  • Possibility 2 Write the Pascal compiler in
    some other language L, that is already
    implemented on M. Then, compile the compiler.
  • But, ... this is probably too much work.

P M
P M
L
L
M
M
M
L Compiler
6
Bootstrapping
  • 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.

P M
P M
L
L
M
M
M
7
Bootstrapping
  • Step 2
  • If P is choosen well, the P -gt M compiler and the
    Pascal -gt M compiler (in P) together, are easier
    to write than the Pascal -gt M (in L) compiler.
  • Theoretically, this process can go on
    indefinitely, bootstrapping up the level of the
    language. In practice, however, new constructs
    interfere with each other (and with old ones),
    until further bootstrapping becomes ummanageable

Pascal M
Pascal M
P
P
M
M
M
Write this
8
Bootstrapping
  • 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.

9
Bootstrapping
  • Possibility 4
  • Step 1 Same as for M (implement P on M).
  • Step 2 Modify the Pascal compiler.

Pascal
M
By hand
P
Pascal M
Pascal M
P
P
M
M
M
10
Bootstrapping
  • Possibility 5 Dont use P! Use the
    implementation of Pascal on M instead.
  • Step 1

Pascal
M
By hand
P
Pascal M
Pascal M
Pascal
M
Pascal
M
M
11
Bootstrapping
  • Step 2
  • Note Possibility 5 is called cross-compiling.

Pascal M
Pascal M
Pascal
M
Pascal
M
M
By hand
12
Bootstrapping
  • 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.
Write a Comment
User Comments (0)
About PowerShow.com