ABSTRACT
Structure-analyzing metaprograms remain largely type-unsafe. In programming languages that support meta-programming, the type system is not strong enough to guarantee that well-typed metaprograms produce only well-typed programs. Banning facilities for code analysis from the meta-programming toolbox in order to achieve type soundness, robs programmers of useful tools such as ability to specify powerful code transformations. We present code pattern types, types that reason about the structure of programs through pattern matching and supports type safe code analysis.
- G. Dos Reis. A system for axiomatic programming. In Intelligent Computer Mathematics, CICM 2012, pages 295--305. Springer Berlin Heidelberg, 2012. Google ScholarDigital Library
- V. Gapeyev, M. Y. Levin, and B. C. Pierce. Recursive subtyping revealed. J. Funct. Program., 12(6):511--548, Nov. 2002. Google ScholarDigital Library
- T. Jim and J. Palsberg. Type inference in systems of recursive types with subtyping. Manuscript, 1997.Google Scholar
- G. Mainland. Explicitly heterogeneous metaprogramming with metahaskell. In Proceedings of the 17th ACM SIGPLAN International Conference on Functional Programming, ICFP '12, pages 311--322, New York, NY, USA, 2012. ACM. Google ScholarDigital Library
- T. Sheard. Accomplishments and research challenges in meta-programming. In In 2nd Int. Workshop on Semantics, Applications, and Implementation of Program Generation, LNCS 2196, pages 2--44. Springer-Verlag, 2000. Google ScholarDigital Library
- W. Taha and T. Sheard. Multi-stage programming with explicit annotations. In Proceedings of the 1997 ACM SIGPLAN Symposium on Partial Evaluation and Semantics-based Program Manipulation, PEPM '97, pages 203--217, New York, NY, USA, 1997. ACM. Google ScholarDigital Library
Index Terms
- Meta-programming with well-typed code analysis
Recommendations
Typed syntactic meta-programming
ICFP '13We present a novel set of meta-programming primitives for use in a dependently-typed functional language. The types of our meta-programs provide strong and precise guarantees about their termination, correctness and completeness. Our system supports ...
Typed syntactic meta-programming
ICFP '13: Proceedings of the 18th ACM SIGPLAN international conference on Functional programmingWe present a novel set of meta-programming primitives for use in a dependently-typed functional language. The types of our meta-programs provide strong and precise guarantees about their termination, correctness and completeness. Our system supports ...
Meta-programming through typeful code representation
By allowing the programmer to write code that can generate code at run-time, meta-programming offers a powerful approach to program construction. For instance, meta-programming can often be employed to enhance program efficiency and facilitate the ...
Comments