C++ Templates as Partial Evaluation
<|reference_start|>C++ Templates as Partial Evaluation: This paper explores the relationship between C++ templates and partial evaluation. Templates were designed to support generic programming, but unintentionally provided the ability to perform compile-time computations and code generation. These features are completely accidental, and as a result their syntax is awkward. By recasting these features in terms of partial evaluation, a much simpler syntax can be achieved. C++ may be regarded as a two-level language in which types are first-class values. Template instantiation resembles an offline partial evaluator. This paper describes preliminary work toward a single mechanism based on Partial Evaluation which unifies generic programming, compile-time computation and code generation. The language Catat is introduced to illustrate these ideas.<|reference_end|>
@article{veldhuizen1998c++,
    title={C++ Templates as Partial Evaluation},
    author={Todd L. Veldhuizen},
    journal={arXiv preprint arXiv:cs/9810010},
    year={1998},
    number={IUCS 519},
    archivePrefix={arXiv},
    eprint={cs/9810010},
    primaryClass={cs.PL cs.PF}
}