Concoqtion: indexed types now!

Almost twenty years after the pioneering efforts of Cardelli, the programming languages community is vigorously pursuing ways to incorporate Fω-style indexed types into programming languages. This paper advocates Concoqtion, a practical approach to adding such highly expressive types to full-fledged programming languages. The approach is applied to MetaOCaml using the Coq proof checker to conservatively extend Hindley-Milner type inference. The implementation of MetaOCaml Concoqtion requires minimal modifications to the syntax, the type checker, and the compiler; and yields a language comparable in notation to the leading proposals. The resulting language provides unlimited expressiveness in the type system while maintaining decidability. Furthermore, programmers can take advantage of a wide range of libraries not only for the programming language but also for the indexed types. Programming in MetaOCaml Concoqtion is illustrated with small examples and a case study implementing a statically-typed domain-specific language.

[1]  Conor McBride,et al.  Inductive Families Need Not Store Their Indices , 2003, TYPES.

[2]  Walid Taha,et al.  A Gentle Introduction to Multi-stage Programming , 2003, Domain-Specific Program Generation.

[3]  Xavier Leroy,et al.  Formal certification of a compiler back-end or: programming a compiler with a proof assistant , 2006, POPL '06.

[4]  Luca Cardelli,et al.  Typeful Programming , 1989, Formal Description of Programming Concepts.

[5]  Andrew Kennedy,et al.  Generalized algebraic data types and object-oriented programming , 2005, OOPSLA '05.

[6]  Gang Chen,et al.  Guarded recursive datatype constructors , 2003, POPL '03.

[7]  Paul Hudak,et al.  Modular domain specific languages and tools , 1998, Proceedings. Fifth International Conference on Software Reuse (Cat. No.98TB100203).

[8]  Hugo Herbelin,et al.  The Coq proof assistant : reference manual, version 6.1 , 1997 .

[9]  Chiyan Chen,et al.  Combining programming with theorem proving , 2005, ICFP '05.

[10]  Frank Pfenning,et al.  Eliminating array bound checking through dependent types , 1998, PLDI.

[11]  Zhong Shao,et al.  A type system for certi .ed binaries , 2002, Foundations of Intrusion Tolerant Systems, 2003 [Organically Assured and Survivable Information Systems].

[12]  James Cheney,et al.  First-Class Phantom Types , 2003 .

[13]  Walid Taha,et al.  Tagless staged interpreters for typed languages , 2002, ICFP '02.

[14]  James Cheney,et al.  Cyclone: A Safe Dialect of C , 2002, USENIX Annual Technical Conference, General Track.

[15]  Simon L. Peyton Jones,et al.  Simple unification-based type inference for GADTs , 2006, ICFP '06.

[16]  J. Y. Girard,et al.  Interpretation fonctionelle et elimination des coupures dans l'aritmetique d'ordre superieur , 1972 .

[17]  Lennart Augustsson,et al.  Cayenne—a language with dependent types , 1998, ICFP '98.

[18]  Tim Sheard Languages of the future , 2004, ACM SIGPLAN Notices.

[19]  Chiyan Chen,et al.  Implementing typeful program transformations , 2003, PEPM '03.

[20]  Thierry Coquand,et al.  Constructions: A Higher Order Proof System for Mechanizing Mathematics , 1985, European Conference on Computer Algebra.

[21]  Krzysztof Czarnecki,et al.  DSL Implementation in MetaOCaml, Template Haskell, and C++ , 2003, Domain-Specific Program Generation.

[22]  François Pottier,et al.  A constraint-based approach to guarded algebraic data types , 2007, TOPL.

[23]  Walid Taha,et al.  Multi-stage programming with explicit annotations , 1997 .

[24]  Emir Pasalic,et al.  Meta-programming With Built-in Type Equality , 2008, Electron. Notes Theor. Comput. Sci..

[25]  Neil D. Jones,et al.  Mix: A self-applicable partial evaluator for experiments in compiler generation , 1989, LISP Symb. Comput..

[26]  Frank Pfenning,et al.  Dependent types in practical programming , 1999, POPL '99.

[27]  Walid Taha,et al.  Tag Elimination and Jones-Optimality , 2001, PADO.

[28]  Walid Taha,et al.  Environment classifiers , 2003, POPL '03.