Tiger Compiler
Tiger in Stratego -- Compilation by Program Transformation
Basic Compiler
The Tiger compiler compiles
TigerLanguage programs to
MIPS assembly code, which can be simulated by the
SpimSimulator.
The compiler consists of several
CompilerComponents that can be composed in various ways. The
CompilerArchitecture is such that it is easy to plug in new components.
The compiler is distributed in the following packages:
- TigerFront: parsing, typechecking, evaluation
- TigerOpt: optimization
- TigerTrans: translation to intermediate code
- ASM: translation from intermediate code to asssebly code
- TigerXmpl: example Tiger programs
Note that some of these packages contain incomplete template implementations of some of the components. This is because the specification of these components is an assignment in the
High-Performance Compilers course at Utrecht University.
Most of the components of the compiler are implemented in
Stratego, a language for program transformation.
Extensions
Language extensions
- Add a module system and separate compilation
- Function arguments (escaping functions)
- Objects
Compiler improvements
- Allocate non-escaping records and arrays on the stack
- Garbage collection
- Partial evaluation / specialization
- Target different platforms (e.g. Intel)
- Parallel execution
- Improve spilling heuristics in the register allocator
- Improve stack allocation of escaping variables (overlap variables that are not live at the same time)