5 research outputs found

    Portable Implementation of Continuation Operators in Imperative Languages by Exception Handling

    No full text
    This paper describes a scheme of manipulating (partial) continuations in imperative languages such as Java and C++ in a portable manner, where the portability means that this scheme does not depend on structure of the native stack frame nor implementation of virtual machines and runtime systems. Exception handling plays a significant role in this scheme to reduce overheads. The scheme is based on program transformation, but in contrast to CPS transformation, our scheme preserves the call graph of the original program. This scheme has two important applications: transparent migration in mobile computation and checkpointing in a highly reliable system. The former technology enables running computations to move to a remote computer, while the latter one enables running computations to be saved into storages

    Defunctionalized Interpreters for Call-by-Need Evaluation

    No full text
    Abstract. Starting from the standard call-by-need reduction for the λ-calculus that is common to Ariola, Felleisen, Maraist, Odersky, and Wadler, we inter-derive a series of hygienic semantic artifacts: a reduction-free stateless abstract machine, a continuation-passing evaluation func-tion, and what appears to be the first heapless natural semantics for call-by-need evaluation. Furthermore we observe that a data structure and a judgment in this natural semantics are in defunctionalized form. The refunctionalized counterpart of this evaluation function is an ex-tended direct semantics in the sense of Cartwright and Felleisen. Overall, the semantic artifacts presented here are simpler than many other such artifacts that have been independently worked out, and which require ingenuity, skill, and independent soundness proofs on a case-by-case basis. They are also simpler to inter-derive because the inter-derivational tools (e.g., refocusing and defunctionalization) already exist.
    corecore