12-06-2012, 04:45 PM
Compiler, Interpreter, and Bootstrapping
Compiler, Interpreter.ppt (Size: 174 KB / Downloads: 186)
Motivation:
When we are asked to write a
Compiler for a complex source language or
Interpreter for a low level intermediate language or
Emulator for a new virtual machine
Our strategy?
Strategy:
machine code VS high level language
scratch VS improve existing code
We introduce some basic concepts and give
some examples to make stuff clear.
Interpreters versus Compilers
Each faction hold the inverted set of advantages against the other.
This part covered in previous presentation.
A comprise exists between two extremes to achieve reasonable compilation and acceptable run time performance.
Define an intermediate language.
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.
Conclusion
To write a good compiler you may be writing several simpler ones first
You have to think about the source language, the target language and the implementation language.
The work of a compiler writer is never finished, there is always version 1.x and version 2.0 and …