- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is Compiler Bootstrapping?
It is an approach for making a self-compiling compiler that is a compiler written in the source programming language that it determine to compile. A bootstrap compiler can compile the compiler and thus you can use this compiled compiler to compile everything else and the future versions of itself.
Uses of Bootstrapping
There are various uses of bootstrapping which are as follows −
It can allow new programming languages and compilers to be developed starting from actual ones.
It allows new features to be combined with a programming language and its compiler.
It also allows new optimizations to be added to compilers.
It allows languages and compilers to be transferred between processors with different instruction sets
Advantages of Bootstrapping
There are various advantages of bootstrapping which are as follows −
Compiler development can be performed in the higher-level language being compiled.
It is a non-trivial test of the language being compiled.
It is an inclusive consistency check as it must be capable of recreating its object code.
For bootstrapping, a compiler is defined by three languages −
S→Source language it compiles.
T→Target language it generates.
I→Implementation language that it is written in
These languages can be represented using a T-diagram as
A compiler is characterized by three languages as its source language, its object language, and the language in which it is written. These languages may be quite different. A compiler can run on one machine and produce target code for another machine. Such a compiler is known as a cross-compiler.
If it can write a cross-compiler for a new language 'L' in execution languages 'S' to generate a program for machine 'N'.
If a current compiler for S runs on machine M and generates a program for M, it is defined by SMM.
If LSN runs through SMM, we get a compiler LMN, i.e., a compiler from L to N that runs on M.
Example − Create a cross compiler using bootstrapping when SsM runs on SAA.
Solution − First of all, it represents two compilers with T-diagram.
When SsM runs on SAA, SAM will be generated.
- Related Articles
- What is Compiler Design?
- What is Compiler Passes?
- Python bootstrapping the pip installer
- What is Just-In-Time compiler?
- What is the difference between One-Pass Compiler and Multi-Pass Compiler?
- What is Chomsky Hierarchy in compiler design?
- What is error handling in compiler design?
- What is Input Buffering in Compiler Design?
- What is Finite Automata in Compiler Design?
- How is JIT compiler different from normal compiler?
- What is the difference between Compiler and Interpreter?
- What is Language Processing Systems in Compiler Design?
- What is the role of Compiler Construction Tools?
- What is minimizing of DFA in compiler design?
- What is the Representation of DFA in compiler design?