Refined Environment Classifiers - Type- and Scope-Safe Code Generation with Mutable Cells

Generating high-performance code and applying typical optimizations within the bodies of loops and functions involves moving or storing open code for later use, often in a different binding environment. There are ample opportunities for variables being left unbound or accidentally captured. It has been a tough challenge to statically ensure that by construction the generated code is nevertheless well-typed and well-scoped: all free variables in manipulated and stored code fragments shall eventually be bound, by their intended binders.

[1]  Martin Odersky,et al.  Higher-order and Symbolic Computation Manuscript No. Scala-virtualized: Linguistic Reuse for Deep Embeddings , 2022 .

[2]  Chung-chieh Shan,et al.  Combinators for impure yet hygienic code generation , 2014, PEPM '14.

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

[4]  Didier Rémy,et al.  MLF: raising ML to the power of system F , 2003, ICFP '03.

[5]  Kwangkeun Yi,et al.  A polymorphic modal type system for lisp-like multi-staged languages , 2006, POPL '06.

[6]  Chiyan Chen,et al.  Meta-programming through typeful code representation , 2005, J. Funct. Program..

[7]  Walid Taha,et al.  Environment classifiers , 2003, POPL.

[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]  Rong Zeng,et al.  The Design and Implementation of , 2002 .

[10]  Didier Rémy,et al.  MLF: raising ML to the power of system F , 2003, ACM SIGPLAN Notices.

[11]  François Pottier,et al.  A fresh look at programming with names and binders , 2010, ICFP '10.

[12]  Peter Thiemann,et al.  Combinators for program generation , 1999, Journal of Functional Programming.

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

[14]  Walid Taha,et al.  Implementing Multi-stage Languages Using ASTs, Gensym, and Reflection , 2003, GPCE.

[15]  Frank Pfenning,et al.  Contextual modal type theory , 2008, TOCL.

[16]  Oleg Kiselyov The Design and Implementation of BER MetaOCaml - System Description , 2014, FLOPS.

[17]  Walid Taha,et al.  Mint: Java multi-stage programming using weak separability , 2010, PLDI '10.

[18]  François Pottier,et al.  Static Name Control for FreshML , 2007, 22nd Annual IEEE Symposium on Logic in Computer Science (LICS 2007).

[19]  J. Gregory Morrisett,et al.  Monadic regions , 2004, ICFP '04.

[20]  Didier Rémy,et al.  MLF: raising ML to the power of system F , 2014, SIGP.