Version 1.0

Bootstrapping David May: February 27, 2015

Introduction Bootstrapping is a technique that is widely used in compiler development. It has four main uses: 1. It enables new programming languages and compilers to be developed starting from existing ones. 2. It enables new features to be added to a programming language and its compiler. 3. It also allows new optimisations to be added to compilers. 4. It allows languages and compilers to be transferred between processors with different instruction sets New programming languages Let Sxy be the source of a compiler for language y written in language x, and let Ex be an executable compiler for language x. Suppose b is a new programming language and that there is a source Sab of a compiler for b written in a. An executable compiler for b can be created using the executable compiler for a: Eb = Ea (Sab ) Assuming that language b is expressive enough to write a compiler, it can now be used to write its own compiler. The pair Sbb , Eb can then be used to compile Sbb into Eb in place of Sba , Ea and: Eb = Eb (Sbb ) This means that language a is no longer needed in the further development of language b.

David May: February 27, 2015

1

Version 1.0

Adding new features The process of adding new features is similar to that of developing a new programming language. Let Sxy be the source of a compiler for language y written in language x, and let Ex be an executable compiler for language x. Assuming that the Ea and Saa are correct: Ea = Ea (Saa ) Suppose language b is a superset of language a. An executable compiler for b can be created using the executable compiler for a: Eb = Ea (Sab ) The pair Sbb , Eb can then be used to compile Sbb into Eb in place of Sba , Ea and: Eb = Eb (Sbb ) Notice that this process can be carried out repeatedly, starting from a very simple language and progressively adding syntactic or semantic features. Once included in the executable version of the compiler, a new feature can be used in the source of the compiler. Compiler optimisation Let Si be the source of a compiler for language a written in language a, and let Ei be an executable compiler for language a. Assuming that the Ei and Si are correct: Ei = Ei (Si ) Let Si+1 be the source of an optimising compiler for language a written in language a. An executable optimising compiler Oi can be created: Oi = Ei (Si+1 ) Note that Oi can optimise, but has not itself been optimised. However, it can now be used to create an optimised version of the executable optimising compiler: Ei+1 = Oi (Si+1 ) Now the pair Ei+1 , Si+1 can be used in place of Ei , Si and: Ei+1 = Ei+1 (Si+1 ) Notice that this process can be carried out repeatedly, starting from a very simDavid May: February 27, 2015

2

Version 1.0

ple non-optimising compiler and progressively introducing optimisations. As the process continues, the new optimisations are applied to the compiler itself. This means that the executable compiler may reduce in size even though the source becomes larger and more complex. Transferring to a new instruction set Let Sx be the source of a compiler for instruction set x, and let Exy be an executable compiler in instruction set x that compiles programs into instruction set y. Assuming that the Eaa and Sa are correct: Eaa = Eaa (Sa ) Suppose b is a new instruction set and that there is a source of a compiler for b. An executable compiler in instruction set b can be created using the executable compiler in a: Eab = Eaa (Sb ) Now Eab can be used to create an executable compiler in instruction set b that compiles programs into instruction set b: Ebb = Eab (Sb ) The pair Sb , Eb can then be used to compile Sb into Ebb in place of Sb , Eaa and: Ebb = Ebb (Sb ) This means that the compiler has been transferred to the new instruction set b (and a is no longer needed). Footnote In using the above technique, it is essential to maintain a matching pair S, E that can be used to exactly reproduce E. The best way to do this is to perform E 0 = E(S) and check that the binary images of E 0 and E are identical.

David May: February 27, 2015

3

Unit 1 bootstrapping.pdf

There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item.

49KB Sizes 0 Downloads 248 Views

Recommend Documents

UNIT-1 - PDFKUL.COM
If P is a permutation matrix of order 5 x 5, why is P6 = I? Also find a non-zero vector x so that (I – P)x = 0. 30. Solve using Gauss-Jordan method: 1 a b. 1. 0. 0. 0. 1.

UNIT-1 -
From the cubics P3 to the fourth degree polynomials P4. What matrix ... There are 2 bases : v1, v2 ,…..vn and w1, w2,….wn for Rn. If a vector x Є Rn is such that.

Curriculum Unit 1 - Pearson
Curriculum Unit 4. What Would You Rather Be? (Data Analysis) attribute compare data describe equation representation sorting survey tally mark. Curriculum Unit 5. Fish Lengths and Animal Jumps. (Measurement) distance height in-between inch length lon

Unit 1 Chapter 1.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Unit 1 Chapter ...

unit 1 understanding groups - eGyanKosh
collective security. Third, the group became both a creator and a transmitter of culture, language and technical know-how beliefs and art forms, games and.

unit 1.pdf
need for DBMS exploding. DBMS encompasses most of CS. OS, languages, theory, AI, multimedia, logic. Files vs. DBMS. Application must stage large ...

Unit 1 Ecommerce.pdf
E-commerce is based on the electronic processing and transmission of data. It is encompasses. many devices activities including electronic trading of goods and ...

Unit 1 Vocabulary
2. Aristocracy- any class or group considered to be superior, as through education, ability, wealth, or social prestige. 3. Autocracy- a form of government in which a country is ruled by a person or group with total power. 4. Constitution- the system

Course 1 Unit 3 Practice
Feb 19, 2015 - than her brother Dyami. The sum of their ages is. 23 years. How old is Dyami? 25. Corrine and Elizabeth went out for dinner. The check for their dinner was $32.75. Corrine knows her dinner cost $18.95. How much did Elizabeth's dinner c

Course 1 Unit 2 Practice
Robert lives at 5th Street and 8th Avenue. a. Write each location as an ordered pair. b. What is the distance between Jeremy's home and Adriana's home? c.

unit -1.pdf
Adaptation to prefabrication. Speed of erection. Elasticity. Ductility. Toughness. Suitability to provide additions to existing structures. Disadvantages Of ...

unit 1 understanding groups - eGyanKosh
collectivities are differences of kind. No one would suggest that eggs, caterpillars, pupae, and moths are not part of the same life cycle despite -heir apparent.

Course 1 Unit 2 Practice
SpringBoard Course 1, Unit 2 Practice. LeSSon 7-1. 1. Model with mathematics. Identify the integer at each point. a. 28 b. 0 c. 10 d. 8 e. 25 f. 11. 2. Write the opposite of each integer. a. 1 b. 228 c. 0 d. 2(27) e. |2100| f. 23. 3. Write an integer

Course 2 Unit 1 Practice
Explain how you would divide a mixed number by a fraction. 13. John cut a 4 ft long piece of lumber into shorter pieces to repair his deck. He cut three pieces each. 3. 4 ft long, and two pieces each. 1. 2 ft long. How much ... SpringBoard Course 2,

UNIT-1.PDF
The File System ... In this mode, whatever you type is ... pwd, cd, mkdir, rmdir, ls, cp, mv, rm, cat, more, wc,. Page 2 of 15. Page 3 of 15. UNIT-1.PDF. UNIT-1.PDF.

unit 1 first impressions -- unit test
My mother says that I am a 1__________because I am very messy and don't follow any rules, but I am not a 2___________ boy. I know that I have to centre ...

Algebra 1 Unit 1 Section 1 Patterns Copies.pdf
Algebra 1 Unit 1 Section 1 Patterns Copies.pdf. Algebra 1 Unit 1 Section 1 Patterns Copies.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying ...

PSC unit (1)_NoRestriction.pdf
End encno4g"s- Nnt renrrired Required. 4 G,routing. 5. tnss of Preqllregr --=.- ffi. dead loadi can be counteracted. L^. 6. Dead load counter action ?. Cable Profile.

Unit 1 Review Modern World.notebook
Unit 1 Review Modern World.notebook. 2. January 21, 2015. Questions. Click a number below to answer a question. (Drag the # behind the trash can so you know which have been used!) Q1. Game. Board. When did the Industrial. Revolution start? 1750 ...

CGG Unit 1 & 2.pdf
Loading… Whoops! There was a problem loading more pages. Whoops! There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Main menu. There was a problem previewing

english test unit-1
(3) He is going to temple. (where) ..…………………………………………………………………………………………………………………………………… (4) Brinjal is ...

physics 20n unit 1
moving south along a river at 8.0 m/s. What is the apparent velocity of the man ... A student moves on a straight sidewalk from one school to an adjacent one; she then turns and walks partway back to the first school. School B is straight east of sch

PE_G9_FM and Unit 1
Au revoir,”18 said the general,. “Mr. Rainsford, au ... gentleman and a sportsman.” 18. Au revoir. [French] Until we meet again ..... story to support your response.