Docsity

Compiling and Optimizing Compilers: Concepts and Techniques - Prof. David B. Whalley, Study notes of Computer Science

Partial preview of the text

Download Compiling and Optimizing Compilers: Concepts and Techniques - Prof. David B. Whalley and more Study notes Computer Science in PDF only on Docsity!

Extra Concepts Introduced



Compilation Issues



Bootstrapping



Testing and Maintenance

Compilation Issues



Source Language



Target Language



Performance Criteria

Source Language Issues



Size of the language



Stability of the language

Target Language Issues



Maturity of the architecture



Design of the intermediate language

Performance Criteria



Compiler Speed



Generated Code Quality

รฑ

speed, code size, power consumption



Error Diagnostics



Portability

รฑ

retargetability

รฑ

rehostability



Maintainability

Bootstrapping



Bootstrapping involves using the facilities of thesource language to compile the compiler.



A compiler is characterized by three languages.

  1. S - the source language that it compiles2. T - the target language it generates3. I - the language in which it is implemented



Can be represented with a T diagram. Or with text: S

I

T

Cross Compiling



A cross compiler runs on one machine andproduces target code for another machine.



Example: A cross compiler that compileslanguage L, is written in language L, andproduces code for machine N. An existingcompiler compiles language L, executes onmachine M, and generates code for machine M.

Compiling a New Language



Can write a simple compiler that consists of asubset S of L that executes on machine M andproduces code for machine M. We can then usethis subset S to write a compiler that compiles Linto M code.