Common LISP: the language (2nd ed.)
Common LISP: the language (2nd ed.)
Multi-stage programming with explicit annotations
PEPM '97 Proceedings of the 1997 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation
Cayenne—a language with dependent types
ICFP '98 Proceedings of the third ACM SIGPLAN international conference on Functional programming
Dependent types in practical programming
Proceedings of the 26th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Generative programming: methods, tools, and applications
Generative programming: methods, tools, and applications
Modern C++ design: generic programming and design patterns applied
Modern C++ design: generic programming and design patterns applied
Template meta-programming for Haskell
Proceedings of the 2002 ACM SIGPLAN workshop on Haskell
POPL '03 Proceedings of the 30th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Guarded recursive datatype constructors
POPL '03 Proceedings of the 30th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Multi-Stage Programming: Its Theory and Applications
Multi-Stage Programming: Its Theory and Applications
C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond (C++ in Depth Series)
Concoqtion: indexed types now!
Proceedings of the 2007 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation
Gradual typing with unification-based inference
DLS '08 Proceedings of the 2008 symposium on Dynamic languages
Static computation and reflection
Static computation and reflection
Toward foundations for type-reflective metaprogramming
GPCE '09 Proceedings of the eighth international conference on Generative programming and component engineering
Mixing type checking and symbolic execution
PLDI '10 Proceedings of the 2010 ACM SIGPLAN conference on Programming language design and implementation
Proceedings of the 27th Annual ACM Symposium on Applied Computing
Using functional languages to facilitate C++ metaprogramming
Proceedings of the 8th ACM SIGPLAN workshop on Generic programming
Supporting incremental programming with ghosts
Proceedings of the 2013 International Conference on Software Engineering
Extending Type Inference to Variational Programs
ACM Transactions on Programming Languages and Systems (TOPLAS)
Early detection of type errors in C++ templates
Proceedings of the ACM SIGPLAN 2014 Workshop on Partial Evaluation and Program Manipulation
Hi-index | 0.01 |
Garcia introduces a calculus for type-reflective metaprogramming that provides much of the power and flexibility of C++ templates and solves many of its problems. However, one of the problems that remains is that the residual program is not type checked until after meta computation is complete. Ideally, one would like the type system of the metaprogram to also guarantee that the residual program will type check, as is the case in MetaML. However, in a language with type-reflective metaprogramming, type expressions in the residual program may be the result of meta computation, making the MetaML guarantee next to impossible to achieve. In this paper we offer an approach to detecting errors earlier without sacrificing flexibility: we incrementally type check code fragments as they are created and spliced together during meta computation. The incremental type system is a variant of the gradual type system of Siek and Taha, in which we use type variables to represent type expressions that are not yet normalized and a new dynamic variation on existential types to represent residual code fragments. A type error in a code fragment is treated as a run-time error of the meta computation. We show that the incremental type checker can be implemented efficiently and we prove that if a well-typed metaprogram generates a residual program, then the residual program is also well-typed.