Compile-time program optimizations are similar to poetry: more are written than are actually published in commercial compilers. Hard economic reality is that many interesting optimizations have too narrow an audience to justify their cost in a general-purpose compiler, and custom compilers are too expensive to write. An alternative is to allow programmers to define their own compiletime optimizations. This has already happened accidentally for C++, albeit imperfectly, in the form of template metaprogramming. This paper surveys the problems, the accidental success, and what directions future research might take to circumvent current economic limitations of monolithic compilers. Categories and Subject Descriptors D.3.4 [Programming Languages]: Compilers, Optimization. General Terms Performance, Economics, Languages. Keywords Compilers, Economics, Optimization.
Arch D. Robison