Closed Types as a Simple Approach to Safe Imperative Multi-stage Programming

Safely adding computational effects to a multi-stage language has been an open problem. In previous work, a closed type constructor was used to provide a safe mechanism for executing dynamically generated code. This paper proposes a general notion of closed type as a simple approach to safely introducing computational effects into multistage languages. We demonstrate this approach formally in a core language called Mini-MLrefBN. This core language combines safely multi-stage constructs and ML-style references. In addition to incorporating state, Mini-MLrefBN also embodies a number of technical improvements over previously proposed core languages for multi-stage programming.

[1]  David B. MacQueen,et al.  The Definition of Standard ML (Revised) , 1997 .

[2]  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.

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

[4]  Gordon D. Plotkin,et al.  Call-by-Name, Call-by-Value and the lambda-Calculus , 1975, Theor. Comput. Sci..

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

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

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

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

[9]  Frank Pfenning,et al.  A modal analysis of staged computation , 1996, POPL '96.

[10]  StatePeter Thiemann Partial Evaluation for Higher-Order Languages with , 1996 .

[11]  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.

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

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

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

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

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

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

[18]  Walid Taha,et al.  Multi-Stage Programming: Axiomatization and Type Safety , 1998, ICALP.

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

[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.