Challenging problems in partial evaluation and mixed computation
New Generation Computing - Special Issue: Selected Papers from the Workshop on Partial Evaluation and Mixed
Continuation-based partial evaluation
LFP '94 Proceedings of the 1994 ACM conference on LISP and functional programming
A syntactic approach to type soundness
Information and Computation
Parametricity and local variables
Journal of the ACM (JACM)
Lisp and Symbolic Computation - Special issue on state in programming languages (part I)
POPL '96 Proceedings of the 23rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
An Automatic Program Generator for Multi-Level Specialization
Lisp and Symbolic Computation
PEPM '00 Proceedings of the 2000 ACM SIGPLAN workshop on Partial evaluation and semantics-based program manipulation
A modal analysis of staged computation
Journal of the ACM (JACM)
Online partial evaluation for shift and reset
PEPM '02 Proceedings of the 2002 ACM SIGPLAN workshop on Partial evaluation and semantics-based program manipulation
A Hybrid Approach to Online and Offline Partial Evaluation
Higher-Order and Symbolic Computation
POPL '03 Proceedings of the 30th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Explicit Substitutions for Constructive Necessity
ICALP '98 Proceedings of the 25th International Colloquium on Automata, Languages and Programming
Multi-Level Lambda-Calculi: An Algebraic Description
Selected Papers from the Internaltional Seminar on Partial Evaluation
A Proof Theory for Generic Judgments: An extended abstract
LICS '03 Proceedings of the 18th Annual IEEE Symposium on Logic in Computer Science
Multistage programming: its theory and applications
Multistage programming: its theory and applications
Hume: a domain-specific language for real-time embedded systems
Proceedings of the 2nd international conference on Generative programming and component engineering
Extensional normalisation and type-directed partial evaluation for typed lambda calculus with sums
Proceedings of the 31st ACM SIGPLAN-SIGACT symposium on Principles of programming languages
The call-by-need lambda calculus
Journal of Functional Programming
The call-by-need lambda calculus
Journal of Functional Programming
Programming graphics processors functionally
Haskell '04 Proceedings of the 2004 ACM SIGPLAN workshop on Haskell
A polymorphic modal type system for lisp-like multi-staged languages
Conference record of the 33rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
A monadic approach for avoiding code duplication when staging memoized functions
Proceedings of the 2006 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation
A modal type system for multi-level generating extensions with persistent code
Proceedings of the 8th ACM SIGPLAN international conference on Principles and practice of declarative programming
ACM Transactions on Computational Logic (TOCL)
Invited talk: resource-aware programming
ICESS'04 Proceedings of the First international conference on Embedded Software and Systems
Multi-stage programming with functors and monads: eliminating abstraction overhead from generic code
GPCE'05 Proceedings of the 4th international conference on Generative Programming and Component Engineering
Lazy evaluation and delimited control
Proceedings of the 36th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Shifting the stage: staging with delimited control
Proceedings of the 2009 ACM SIGPLAN workshop on Partial evaluation and program manipulation
Mint: Java multi-stage programming using weak separability
PLDI '10 Proceedings of the 2010 ACM SIGPLAN conference on Programming language design and implementation
Lightweight modular staging: a pragmatic approach to runtime code generation and compiled DSLs
GPCE '10 Proceedings of the ninth international conference on Generative programming and component engineering
Static analysis of multi-staged programs via unstaging translation
Proceedings of the 38th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Shifting the stage: Staging with delimited control
Journal of Functional Programming
Explicitly heterogeneous metaprogramming with MetaHaskell
Proceedings of the 17th ACM SIGPLAN international conference on Functional programming
Hi-index | 0.00 |
Code generation lets us write well-abstracted programs without performance penalty. Writing a correct code generator is easier than building a full-scale compiler but still hard. Typed multistage languages such as MetaOCaml help in two ways: they provide simple annotations to express code generation, and they assure that the generated code is well-typed and well-scoped. Unfortunately, the assurance only holds without side effects such as state and control. Without effects, generators often have to be written in a continuation-passing or monadic style that has proved inconvenient. It is thus a pressing open problem to combine effects with staging in a sound type system. This paper takes a first step towards solving the problem, by translating the staging away. Our source language models MetaOCaml restricted to one future stage. It is a call-by-value language, with a sound type system and a small-step operational semantics, that supports building open code, running closed code, cross-stage persistence, and non-termination effects. We translate each typing derivation from this source language to the unstaged System F with constants. Our translation represents future-stage code using closures, yet preserves the typing, α-equivalence (hygiene), and (we conjecture) termination and evaluation order of the staged program. To decouple evaluation from scope (a defining characteristic of staging), our translation weakens the typing environment of open code using a term coercion reminiscent of Goedel's translation from intuitionistic to modal logic. By converting open code to closures with typed environments, our translation establishes a framework in which to study staging with effects and to prototype staged languages. It already makes scope extrusion a type error.