Lecture 13: Code Generation
In this lecture we study the definition of code generators that transform source language abstract syntax trees into target language programs.
Topics
- Compilation schemas
- Correctness of generated code
- syntactic correctness
- type correctness
- semantics preservation
- Mechanics of code generation
- string interpolation
- code generation by term transformation
- meta-programming with concrete object syntax
- Optimizing generated code
- peephole optimizations
- tail recursion elimination
Slides
Reading Material
- Eelco Visser. Meta-programming with Concrete Object Syntax. In Don S. Batory, Charles Consel, Walid Taha, editors, Generative Programming and Component Engineering, ACM SIGPLAN/SIGSOFT Conference, GPCE 2002, Pittsburgh, PA, USA, October 6-8, 2002, Proceedings. Volume 2487 of Lecture Notes in Computer Science, pages 299-315, Springer, 2002. [doi:10.1007/3-540-45821-2_19]https://doi.org/10.1007/3-540-45821-2_19