Languages such as Java and Scala allow programmers to write compiler extensions, or plugins, that extend the host programming language with new functionality to enable additional static checking and code transformations.   However, by permitting arbitrary code transformations, compiler plugins can change the host language semantics in unexpected ways. Moreover, plugins do not compose. Plugins can interfere with each other such that one plugin can undo the effects of another, or worse, cause another plugin to generate incorrect code.   In this paper, we develop a theoretical framework for  harmless compiler plugins . Host language programs are annotated to limit the scope of plugins. Plugins may change the termination behavior of code outside these scopes, but they are prohibited from changing the values computed by the original computation. The framework is based on an extension of Welterweight Java and uses an information-flow type system to limit plugin effects.
['Nathaniel Nystrom']
Harmless compiler plugins