Compiler - Introduction
Compiler - Introduction
Introduction to Compilers
Organization of a computer
Categorization of System Software
Text Editors
Compilers
Assemblers
Linkers
Loaders
Macro processor
Compilers
Definition: a program that converts instructions into a
machine-code or lower-level form so that they can be
read and executed by a computer
INTERPRETER COMPILER
Translates program one statement at a Scans the entire program and translates it
time. as a whole into machine code.
It takes less amount of time to analyze the It takes large amount of time to analyze
source code but the overall execution time the source code but the overall execution
is slower. time is comparatively faster.
Continues translating the program until the It generates the error message only after
first error is met, in which case it stops. scanning the whole program. Hence
Hence debugging is easy. debugging is comparatively hard.
Programming language like Python, Ruby Programming language like C, C++ use
use interpreters. compilers.
History of Compilers
Corrado Bohm – 1951
Navy Electronics Laboratory
International ALGOL Compiler - NELIAC
Lisp
Forth
Source program
Preprocessor
Compiler
Assembler
Linker/Loader
Second Generation
◦ Assembly languages
Third Generation
◦ Fortran, Cobol, Lisp, C, C++, C#, Java
Fourth Generation
◦ NOMAD, SQL, Postscript
Fifth Generation
◦ Prolog
Impact on Compilers
Advances in programming language – new
algorithms and representations
Program Translations