Multistage programming support in CLI

Execution environments such as CLR and JVM provide many features needed by multi-stage programming languages, though there is no explicit support for them. Besides, staged computations are widely used in areas such as Web programming and generative programming. In the paper the authors present a possible CLR extension (which can also be ported to JVM) to provide support for multi-stage languages. The extension is based on CodeBricks - a framework for run-time code generation which allows expressing homogenous transformations of intermediate language as a composition of methods. They discuss the code generation strategy adopted by the framework and how an extension to CLR may improve the performance of multi-stage applications, although CodeBricks can also be implemented using the standard CLR. An informal discussion of how to translate MetaML staging annotations into CodeBricks is provided with a simple example.