Back to search

[Bloomington, Ind.] : Indiana University

Static Computation and Reflection

Abstract

dc:description.abstract

Most programming languages do not allow programs to inspect their static type information or perform computations on it. C++, however, lets programmers write template metaprograms, which enable programs to encode static information, perform compile-time computations, and make static decisions about run-time behavior. Many C++ libraries and applications use template metaprogramming to build specialized abstraction mechanisms, implement domain-specific safety checks, and improve run-time performance. Template metaprogramming is an emergent capability of the C++ type system, and the C++ language specification is informal and imprecise. As a result, template metaprogramming often involves heroic programming feats and often leads to code that is difficult to read and maintain. Furthermore, many template-based code generation and optimization techniques rely on particular compiler implementations, rather than language semantics, for performance gains. Motivated by the capabilities and techniques of C++ template metaprogramming, this thesis documents some common programming patterns, including static computation, type analysis, generative programming, and the encoding of domain-specific static checks. It also documents notable shortcomings to current practice, including limited support for reflection, semantic ambiguity, and other issues that arise from the pioneering nature of template metaprogramming. Finally, this thesis presents the design of a foundational programming language, motivated by the analysis of template metaprogramming, that allows programs to statically inspect type information, perform computations, and generate code. The language is specified as a core calculus and its capabilities are presented in an idealized setting.

Degree

thesis:*
Grantor dc:publisher
[Bloomington, Ind.] : Indiana University
Year dc:date.issued
2010

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Garcia, Ronald
Advisor dc:contributor.advisor
  • Lumsdaine, Andrew

Subjects

dc:subject × 4

Rights

Language dc:language.iso
EN

Identifiers

dc:identifier.*
Handle dc:identifier.uri
https://hdl.handle.net/2022/8278

Chain of custody

source
Harvested from
Indiana University
Base URL
scholarworks.iu.edu/iuswrrest/oai/request
Last updated
2026-11-19
Source record
OAI-PMH GetRecord
citation

Garcia, Ronald. Static Computation and Reflection. [Bloomington, Ind.] : Indiana University, 2010. https://hdl.handle.net/2022/8278