Proceedings of the 2005 ACM SIGPLAN workshop on Haskell
A multi-stage language with intensional analysis
Proceedings of the 5th international conference on Generative programming and component engineering
System F with type equality coercions
TLDI '07 Proceedings of the 2007 ACM SIGPLAN international workshop on Types in languages design and implementation
Type-Safe Code Transformations in Haskell
Electronic Notes in Theoretical Computer Science (ENTCS)
A type-preserving closure conversion in haskell
Haskell '07 Proceedings of the ACM SIGPLAN workshop on Haskell workshop
A type-preserving compiler in Haskell
Proceedings of the 13th ACM SIGPLAN international conference on Functional programming
Pointwise generalized algebraic data types
Proceedings of the 5th ACM SIGPLAN workshop on Types in language design and implementation
Hi-index | 0.00 |
Meta-programming, writing programs that write other programs, involves two kinds of languages. The meta-language is the language in which meta-programs, which construct or manipulate other programs, are written. The object-language is the language of programs being manipulated. We study a class of meta-language features that are used to write meta-programs that are statically guaranteed to maintain semantic invariants of object-language programs, such as typing and scoping. We use type equality in the type system of the meta-language to check and enforce these invariants. Our main contribution is the illustration of the utility of type equality in typed functional meta-programming. In particular, we encode and capture judgments about many important language features using type equality. Finally, we show how type equality is incorporated as a feature of the type system of a practical functional meta-programming language. The core of this thesis is divided into three parts. First, we design a meta-programming language with dependent types. We use dependent types to ensure that well-typed meta-programs manipulate only well-typed object-language programs. Using this meta-language, we then construct highly efficient and safe interpreters for a strongly typed object language. We also prove the type safety of the meta-language. Second, we demonstrate how the full power of dependent types is not necessary to encode typing properties of object-languages. We explore a meta-language consisting of the programming language Haskell and a set of techniques for encoding type equality. In this setting we are able to carry out essentially the same meta-programming examples. We also expand the range of object-language features in our examples (e.g., pattern matching). Third, we design a meta-language (called Omega) with built-in equality proofs. This language is a significant improvement for meta-programming over Haskell: Omega's type system automatically manipulates proofs of type equalities in meta-programs. We further demonstrate our encoding and meta-programming techniques by providing representations and interpreters for object-languages with explicit substitutions and modal type systems.