Closed types for a safe imperative MetaML

This paper addresses the issue of safely combining computational effects and multi-stage programming. We propose a type system which exploits a notion of closed type, to check statically that an imperative multi-stage program does not cause run-time errors. Our approach is demonstrated formally for a core language called $\hbox{\sf MiniML}^{\sf meta}_{\sf ref}$. This core language safely combines multi-stage constructs and ML-style references, and is a conservative extension of $\hbox{\sf MiniML}_{\sf ref}$, a simple imperative subset of SML. In previous work, we introduced a closed type constructor, which was enough to ensure the safe execution of dynamically generated code in the pure fragment of $\hbox{\sf MiniML}^{\sf meta}_{\sf ref}$.

[1]  Cristiano Calcagno,et al.  Multi-Stage Imperative Languages: A Conservative Extension Result , 2000, SAIG.

[2]  Hongwei Xi,et al.  Dead Code Elimination through Dependent Types , 1999, PADL.

[3]  Walid Taha,et al.  A Sound Reduction Semantics for Untyped CBN Multi-stage Computation. Or, the Theory of MetaML is Non-trivial (Extended Abstract) , 1999, PEPM.

[4]  Zine-El-Abidine Benaissa,et al.  Multi-Stage Programming : Axiomatization and Type , 1998 .

[5]  Walid Taha Semantics, Applications, and Implementation of Program Generation , 2003, J. Funct. Program..

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

[7]  Walid Taha,et al.  A sound reduction semantics for untyped CBN mutli-stage computation. Or, the theory of MetaML is non-trival (extended abstract) , 1999, PEPM '00.

[8]  Rowan Davies,et al.  A temporal-logic approach to binding-time analysis , 1995, Proceedings 11th Annual IEEE Symposium on Logic in Computer Science.

[9]  Peter Lee,et al.  Run-time code generation and modal-ML , 1998, PLDI.

[10]  Walid Taha,et al.  Multi-Stage Programming: Its Theory and Applications , 1999 .

[11]  Walid Taha,et al.  An Idealized MetaML: Simpler, and More Expressive , 1999, ESOP.

[12]  Jr. Allen B. Tucker,et al.  The Computer Science and Engineering Handbook , 1997 .

[13]  Olivier Danvy,et al.  A computational formalization for partial evaluation , 1996, Mathematical Structures in Computer Science.

[14]  Samuel N. Kamin,et al.  Lightweight and Generative Components 2: Binary-Level Components , 2000, SAIG.

[15]  Robert Harper,et al.  A Type-Theoretic Account of Standard ML 1996 (Version 1). , 1996 .

[16]  Peter Sestoft,et al.  Partial evaluation and automatic program generation , 1993, Prentice Hall international series in computer science.

[17]  Robert Glück,et al.  Fast Binding-Time Analysis for Multi-Level Specialization , 1996, Ershov Memorial Conference.

[18]  Dominique Clément,et al.  A simple applicative language: mini-ML , 1986, LFP '86.

[19]  Matthias Felleisen,et al.  A Syntactic Approach to Type Soundness , 1994, Inf. Comput..

[20]  Walid Taha,et al.  MetaML and multi-stage programming with explicit annotations , 2000, Theor. Comput. Sci..

[21]  Neil D. Jones,et al.  A partial evaluator for the untyped lambda-calculus , 1991, Journal of Functional Programming.

[22]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[23]  Robin Milner,et al.  Definition of standard ML , 1990 .

[24]  Walid Taha,et al.  Logical Modalities and Multi-Stage Programming , 1999 .

[25]  Walid Taha,et al.  Closed Types as a Simple Approach to Safe Imperative Multi-stage Programming , 2000, ICALP.

[26]  Eugenio Moggi,et al.  Functor Categories and Two-Level Languages , 1998, FoSSaCS.

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

[28]  Manfred Broy,et al.  Perspectives of System Informatics , 2001, Lecture Notes in Computer Science.