Dependent interoperability

In this paper we study the problem of interoperability --- combining constructs from two separate programming languages within one program --- in the case where one of the two languages is dependently typed and the other is simply typed.We present a core calculus called SD, which combines dependently- and simply-typed sub-languages and supports user-defined (dependent) datatypes, among other standard features. SD has "boundary terms" that mediate the interaction between the two sub-languages. The operational semantics of SD demonstrates how the necessary dynamic checks, which must be done when passing a value from the simply-typed world to the dependently typed world, can be extracted from the dependent type constructors themselves, modulo user-defined functions for marshaling values across the boundary.We establish type-safety and other meta-theoretic properties of SD, and contrast this approach to others in the literature.

[1]  Andrew W. Appel,et al.  Safe Java Native Interface , 2006 .

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

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

[4]  David Walker,et al.  Dynamic Typing with Dependent Types , 2004, IFIP TCS.

[5]  Benjamin C. Pierce,et al.  Contracts made manifest , 2010, POPL '10.

[6]  Limin Jia,et al.  Dependent types and program equivalence , 2010, POPL '10.

[7]  Natarajan Shankar,et al.  Subtypes for Specifications: Predicate Subtyping in PVS , 1998, IEEE Trans. Software Eng..

[8]  David M. Beazley,et al.  SWIG: An Easy to Use Tool for Integrating Scripting Languages with C and C++ , 1996, Tcl/Tk Workshop.

[9]  Sheng Liang,et al.  Java Native Interface: Programmer's Guide and Reference , 1999 .

[10]  Frank Pfenning,et al.  Refinement types for ML , 1991, PLDI '91.

[11]  Nick Benton,et al.  Interlanguage working without tears: blending SML with Java , 1999, ICFP '99.

[12]  Riccardo Pucella Towards a formalization for COM part i: the primitive calculus , 2002, OOPSLA '02.

[13]  Pierre Letouzey Extraction in Coq: An Overview , 2008, CiE.

[14]  Masako Takahashi Parallel Reductions in lambda-Calculus , 1995, Inf. Comput..

[15]  Conor McBride Ornamental Algebras, Algebraic Ornaments , 2014 .

[16]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

[17]  Cormac Flanagan,et al.  Hybrid type checking , 2006, POPL '06.

[18]  Philip Wadler,et al.  Well-Typed Programs Can't Be Blamed , 2009, ESOP.

[19]  Xavier Leroy The objective caml system release 3 , 2001 .

[20]  Amal Ahmed,et al.  Parametric Polymorphism through Run-Time Sealing or, Theorems for Low, Low Prices! , 2008, ESOP.

[21]  Sheng Liang,et al.  Java Native Interface: Programmer's Guide and Specification , 1999 .

[22]  U. Norell,et al.  Towards a practical programming language based on dependent type theory , 2007 .

[23]  Matthias Felleisen,et al.  Contracts for higher-order functions , 2002, ICFP '02.

[24]  Robert Bruce Findler,et al.  Operational semantics for multi-language programs , 2007, POPL '07.

[25]  Matthias Blume No-Longer-Foreign: Teaching an ML compiler to speak C "natively" , 2001, Electron. Notes Theor. Comput. Sci..

[26]  Daniel Silva,et al.  From Python to PLT Scheme , 2004 .

[27]  Martín Abadi,et al.  Dynamic typing in a statically-typed language , 1989, POPL '89.

[28]  Simon Marlow,et al.  Haskell 2010 Language Report , 2010 .

[29]  Matthieu Sozeau,et al.  Subset Coercions in Coq , 2006, TYPES.

[30]  Don Syme ILX: Extending the .NET Common IL for Functional Language Interoperability , 2001, Electron. Notes Theor. Comput. Sci..

[31]  Christine Paulin-Mohring,et al.  The coq proof assistant reference manual , 2000 .

[32]  Stephen N. Freund,et al.  Sage: Hybrid Checking for Flexible Specifications , 2006 .

[33]  Timothy W. Simpson,et al.  Verified programming in Guru , 2009, PLPV '09.

[34]  Manuel M. T. Chakravarty C -> HASKELL, or Yet Another Interfacing Tool , 1999, IFL.

[35]  Jan Vitek,et al.  Integrating typed and untyped code in a scripting language , 2010, POPL '10.