SlideShare a Scribd company logo
01/04/15 1
Submitted to:-
Sandeep Manzhi
TECHNOCRATS
INSTITUTE
OF TECHNOLOGY &
SCIENCE
Bootstrapping
2
Bootstrapping
• a number of techniques which
rely on partial/inefficient
compiler version to create a
full/better version
• often compiling a translator
expressed in its own language
3
Full Bootstrapping
• A full bootstrap is necessary when
we are building a new compiler
from scratch.
• Example:
• We want to implement an Ada
compiler for machine M. We don’t
currently have access to any Ada
compiler (not on M, nor on any
other machine).
• Idea: Ada is very large, we will
implement the compiler in a subset
of Ada and bootstrap it from a
subset of Ada compiler in another
language. (e.g. C)
4
Full Bootstrapping
continued
• Step 1: build a compiler for Ada-S in
another language
Ada-S
->M
C
v1
Ada-S
->M
C
v1
Step 1a: build a compiler (v1) for Ada-S in
another language.
5
Full bootstrapping
Ada-S
->M
C
v1
Ada-S-
>M
v1
Step 1b: Compile v1
compiler on M
M
C->M
M
This compiler can be
used for bootstrapping
on machine M but we
do not want to rely on it
permanently!
6
Full Bootstrapping
continued
Ada-S
->M
Ada-S
v2
Step 2a: Implement v2 of Ada-S compiler in Ada-S
Ada-S ->M
Ada-S
v2
M
M
Ada-S->M
v2
Step 2b: Compile v2 compiler with v1 compiler
Ada-S ->M
M
v1
We are now no longer
dependent on the availability o
a C compiler!
7
Full Bootstrapping
continued
Step 3a: Build a full Ada compiler in Ada-S
Ada->M
Ada-
S
v3
Step 3b: Compile with v2 compiler
M
Ada->M
v3
Ada-S
->M
M
v2Ada->M
Ada-
S
v3
M
From this point on we can
maintain the compiler in Ada.
Subsequent versions v4,v5,... of
the compiler in Ada and
compile each with the the
previous version.
8
Half Bootstrapping
We discussed full bootstrapping which is required
when we have no access to a compiler for our
language at all.
Q: What if we have access to an compiler for our
language on a different machine HM but want to
develop one for TM ?
Ada-
>HM
HM
Ada-
>HM
Ada
Ada-
>TM
TM
We have We
want
Idea: we can use cross
compilation from HM to TM to
bootstrap the TM compiler
Cross
compiler:
running on
HM but emits
TM code
9
Half Bootstrapping
continued
Step 1: Implement Ada->TM compiler in Ada
Ada-
>TM
Ada
Step 2: Compile on HM
Ada-
>TM
Ada
HM
Ada-
>HM
HM
Ada->TM
HM
10
Half Bootstrapping
continued
Step 3: Cross compile our TM compiler.
Ada-
>TM
Ada Ada-
>TM
HM
HM
DONE!
TM
From now on we can develop subsequent versions
of the compiler completely on TM
Ada->TM
11
Bootstrap to improve
efficiency
The efficiency of programs and compilers:
Efficiency of programs:
- memory usage
- runtime
Efficiency of compilers:
- Efficiency of the compiler itself
- Efficiency of the emitted code
Idea: We start from a simple compiler (generating
inefficient code) and develop more sophisticated
version of it. We can then use bootstrapping to
improve performance of the compiler.
12
Bootstrap to improve
efficiency
Ada-
>Mslow
Ada
Ada->
Mslow
Mslow
Ada-
>Mfast
Ada
Ada-
>Mfast
Ada
M
Ada-
>Mfast
Mslow
Step 1
Ada->
MslowMslow
We have We want
13
Bootstrap to improve
efficiency
Step 2
Ada-
>Mfast
Ada
M
Ada-
>Mfast
MfastAda->
MfastMslow
Fast compiler
that emits fast
code!

More Related Content

PPT
What is Compiler?
PPT
Compiler Design Basics
PPT
How a Compiler Works ?
PPTX
Compiler vs interpreter
PPTX
compiler and their types
PDF
Compilation v. interpretation
PPT
Language translator
PDF
Compiler type
What is Compiler?
Compiler Design Basics
How a Compiler Works ?
Compiler vs interpreter
compiler and their types
Compilation v. interpretation
Language translator
Compiler type

What's hot (20)

PDF
Compiler design tutorial
PPSX
PPTX
Interpreted and compiled language
PPTX
Types of Compilers
PPTX
Compiler vs interpreter
PDF
COMPILER DESIGN- Introduction & Lexical Analysis:
PPTX
COMPILER DESIGN OPTIONS
PPTX
Translators(Compiler, Assembler) and interpreter
PPTX
Compiler design
PPTX
Chapter 5
PPT
basics of compiler design
PDF
Compiler Design Quiz
PPTX
Language processor
PPTX
Compilers
DOC
Assembler
PPTX
Lecture1 compilers
PPTX
Compilation of c
PPT
Introduction to compiler
PPT
Compiler design
PDF
Compiler design tutorial
Compiler design tutorial
Interpreted and compiled language
Types of Compilers
Compiler vs interpreter
COMPILER DESIGN- Introduction & Lexical Analysis:
COMPILER DESIGN OPTIONS
Translators(Compiler, Assembler) and interpreter
Compiler design
Chapter 5
basics of compiler design
Compiler Design Quiz
Language processor
Compilers
Assembler
Lecture1 compilers
Compilation of c
Introduction to compiler
Compiler design
Compiler design tutorial
Ad

Viewers also liked (20)

PDF
Bootstrapping a Smalltalk - Smalltalks 2012
PPT
Principles of compiler design
PPTX
Chapter one
PPT
Cd unit i
PDF
Compiler Design Introduction
PDF
16 Trends for 2016
ODP
Artificial Intelligence
PPT
Artificial Intelligence
PPTX
Artificial Intelligence
PDF
Design Ethics for Artificial Intelligence
PDF
Compiler design-dec-06
PPTX
Compiler Chapter 1
PDF
10 Event Technology Trends to Watch in 2016
PPTX
Artificial Intelligence Presentation
PPT
Artificial Intelligence
PPT
La 5 Pl Translator
PDF
Deep Learning - The Past, Present and Future of Artificial Intelligence
PPT
02. chapter 3 lexical analysis
PDF
2015 Upload Campaigns Calendar - SlideShare
PPTX
What to Upload to SlideShare
Bootstrapping a Smalltalk - Smalltalks 2012
Principles of compiler design
Chapter one
Cd unit i
Compiler Design Introduction
16 Trends for 2016
Artificial Intelligence
Artificial Intelligence
Artificial Intelligence
Design Ethics for Artificial Intelligence
Compiler design-dec-06
Compiler Chapter 1
10 Event Technology Trends to Watch in 2016
Artificial Intelligence Presentation
Artificial Intelligence
La 5 Pl Translator
Deep Learning - The Past, Present and Future of Artificial Intelligence
02. chapter 3 lexical analysis
2015 Upload Campaigns Calendar - SlideShare
What to Upload to SlideShare
Ad

Similar to Compiler interpreter and_bootstrapping (20)

PPTX
Passes of Compiler.pptx
PPTX
Chapter 1.pptx compiler design lecture note
PDF
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
PPTX
C programming
PDF
Python Introduction
PPT
Passes of compilers
DOCX
Programming in c plus plus2
DOCX
Learn C Programming Full Course Free
PPTX
Cf&oa
PPTX
Programming in C
PPTX
Programming in c
PDF
Learn c programming language in 24 hours allfreebooks.tk
PPTX
CD - CH1 - Introduction to compiler design.pptx
PPTX
Cd ch1 - introduction
PPTX
Structured programming Unit-1-Introduction-to-C-Programming.pptx
PPTX
Transpilers(Source-to-Source Compilers)
PPTX
4_5802928814682016556.pptx
PDF
C plus plus for hackers it security
PPTX
Compiler vs Interpreter-Compiler design ppt.
PPTX
Jit complier
Passes of Compiler.pptx
Chapter 1.pptx compiler design lecture note
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
C programming
Python Introduction
Passes of compilers
Programming in c plus plus2
Learn C Programming Full Course Free
Cf&oa
Programming in C
Programming in c
Learn c programming language in 24 hours allfreebooks.tk
CD - CH1 - Introduction to compiler design.pptx
Cd ch1 - introduction
Structured programming Unit-1-Introduction-to-C-Programming.pptx
Transpilers(Source-to-Source Compilers)
4_5802928814682016556.pptx
C plus plus for hackers it security
Compiler vs Interpreter-Compiler design ppt.
Jit complier

Recently uploaded (20)

DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPT
Project quality management in manufacturing
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPT
introduction to datamining and warehousing
PPTX
additive manufacturing of ss316l using mig welding
PPTX
OOP with Java - Java Introduction (Basics)
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
web development for engineering and engineering
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
Construction Project Organization Group 2.pptx
DOCX
573137875-Attendance-Management-System-original
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
composite construction of structures.pdf
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Project quality management in manufacturing
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
CYBER-CRIMES AND SECURITY A guide to understanding
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
introduction to datamining and warehousing
additive manufacturing of ss316l using mig welding
OOP with Java - Java Introduction (Basics)
Automation-in-Manufacturing-Chapter-Introduction.pdf
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
CH1 Production IntroductoryConcepts.pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
web development for engineering and engineering
Foundation to blockchain - A guide to Blockchain Tech
Construction Project Organization Group 2.pptx
573137875-Attendance-Management-System-original
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
composite construction of structures.pdf

Compiler interpreter and_bootstrapping

  • 1. 01/04/15 1 Submitted to:- Sandeep Manzhi TECHNOCRATS INSTITUTE OF TECHNOLOGY & SCIENCE Bootstrapping
  • 2. 2 Bootstrapping • a number of techniques which rely on partial/inefficient compiler version to create a full/better version • often compiling a translator expressed in its own language
  • 3. 3 Full Bootstrapping • A full bootstrap is necessary when we are building a new compiler from scratch. • Example: • We want to implement an Ada compiler for machine M. We don’t currently have access to any Ada compiler (not on M, nor on any other machine). • Idea: Ada is very large, we will implement the compiler in a subset of Ada and bootstrap it from a subset of Ada compiler in another language. (e.g. C)
  • 4. 4 Full Bootstrapping continued • Step 1: build a compiler for Ada-S in another language Ada-S ->M C v1 Ada-S ->M C v1 Step 1a: build a compiler (v1) for Ada-S in another language.
  • 5. 5 Full bootstrapping Ada-S ->M C v1 Ada-S- >M v1 Step 1b: Compile v1 compiler on M M C->M M This compiler can be used for bootstrapping on machine M but we do not want to rely on it permanently!
  • 6. 6 Full Bootstrapping continued Ada-S ->M Ada-S v2 Step 2a: Implement v2 of Ada-S compiler in Ada-S Ada-S ->M Ada-S v2 M M Ada-S->M v2 Step 2b: Compile v2 compiler with v1 compiler Ada-S ->M M v1 We are now no longer dependent on the availability o a C compiler!
  • 7. 7 Full Bootstrapping continued Step 3a: Build a full Ada compiler in Ada-S Ada->M Ada- S v3 Step 3b: Compile with v2 compiler M Ada->M v3 Ada-S ->M M v2Ada->M Ada- S v3 M From this point on we can maintain the compiler in Ada. Subsequent versions v4,v5,... of the compiler in Ada and compile each with the the previous version.
  • 8. 8 Half Bootstrapping We discussed full bootstrapping which is required when we have no access to a compiler for our language at all. Q: What if we have access to an compiler for our language on a different machine HM but want to develop one for TM ? Ada- >HM HM Ada- >HM Ada Ada- >TM TM We have We want Idea: we can use cross compilation from HM to TM to bootstrap the TM compiler
  • 9. Cross compiler: running on HM but emits TM code 9 Half Bootstrapping continued Step 1: Implement Ada->TM compiler in Ada Ada- >TM Ada Step 2: Compile on HM Ada- >TM Ada HM Ada- >HM HM Ada->TM HM
  • 10. 10 Half Bootstrapping continued Step 3: Cross compile our TM compiler. Ada- >TM Ada Ada- >TM HM HM DONE! TM From now on we can develop subsequent versions of the compiler completely on TM Ada->TM
  • 11. 11 Bootstrap to improve efficiency The efficiency of programs and compilers: Efficiency of programs: - memory usage - runtime Efficiency of compilers: - Efficiency of the compiler itself - Efficiency of the emitted code Idea: We start from a simple compiler (generating inefficient code) and develop more sophisticated version of it. We can then use bootstrapping to improve performance of the compiler.
  • 13. 13 Bootstrap to improve efficiency Step 2 Ada- >Mfast Ada M Ada- >Mfast MfastAda-> MfastMslow Fast compiler that emits fast code!