Dirk Draheim, Christof Lutteroth, Gerald Weber. A Type System for Reflective Program Generators. In Robert Glück, Michael R. Lowry, editors, Generative Programming and Component Engineering, 4th International Conference, GPCE 2005. Volume 3676 of Lecture Notes in Computer Science, pages 327-341, Springer, Tallinn, Estonia, 2005. [doi]
In this paper we describe a type system for a generative mechanism that generalizes the concept of generic types by combining it with a controlled form of reflection. This mechanism makes many code generation tasks possible for which generic types alone would be insufficient. The power of code generation features are carefully balanced with their safety, so that we are able to perform static type checks on generator code. This leads to a generalized notion of type safety for generators.