Results 1  10
of
13
Delimited Dynamic Binding
, 2006
"... Dynamic binding and delimited control are useful together in many settings, including Web applications, database cursors, and mobile code. We examine this pair of language features to show that the semantics of their interaction is illdefined yet not expressive enough for these uses. We solve this ..."
Abstract

Cited by 30 (12 self)
 Add to MetaCart
Dynamic binding and delimited control are useful together in many settings, including Web applications, database cursors, and mobile code. We examine this pair of language features to show that the semantics of their interaction is illdefined yet not expressive enough for these uses. We solve this open and subtle problem. We formalise a typed language DB+DC that combines a calculus DB of dynamic binding and a calculus DC of delimited control. We argue from theoretical and practical points of view that its semantics should be based on delimited dynamic binding: capturing a delimited continuation closes over part of the dynamic environment, rather than all or none of it; reinstating the captured continuation supplements the dynamic environment, rather than replacing or inheriting it. We introduce a type and reductionpreserving translation from DB + DC to DC, which proves that delimited control macroexpresses dynamic binding. We use this translation to implement DB + DC in Scheme, OCaml, and Haskell. We extend DB + DC with mutable dynamic variables and a facility to obtain not only the latest binding of a dynamic variable but also older bindings. This facility provides for stack inspection and (more generally) folding over the execution context as an inductive data structure.
A.: Lazy evaluation and delimited control
 In: POPL ’09: Proceedings of the 36th Annual ACM SIGPLANSIGACT Symposium on Principles of Programming Languages
, 2009
"... The callbyneed lambda calculus provides an equational framework for reasoning syntactically about lazy evaluation. This paper examines its operational characteristics. By a series of reasoning steps, we systematically unpack the standardorder reduction relation of the calculus and discover a nove ..."
Abstract

Cited by 11 (0 self)
 Add to MetaCart
(Show Context)
The callbyneed lambda calculus provides an equational framework for reasoning syntactically about lazy evaluation. This paper examines its operational characteristics. By a series of reasoning steps, we systematically unpack the standardorder reduction relation of the calculus and discover a novel abstract machine definition which, like the calculus, goes “under lambdas. ” We prove that machine evaluation is equivalent to standardorder evaluation. Unlike traditional abstract machines, delimited control plays a significant role in the machine’s behavior. In particular, the machine replaces the manipulation of a heap using storebased effects with disciplined management of the evaluation stack using controlbased effects. In short, state is replaced with control. To further articulate this observation, we present a simulation of callbyneed in a callbyvalue language using delimited control operations.
Adding Delimited and Composable Control to a Production Programming Environment
 ICFP'07
, 2007
"... Operators for delimiting control and for capturing composable continuations litter the landscape of theoretical programming language research. Numerous papers explain their advantages, how the operators explain each other (or don’t), and other aspects of the operators’ existence. Production programm ..."
Abstract

Cited by 10 (1 self)
 Add to MetaCart
Operators for delimiting control and for capturing composable continuations litter the landscape of theoretical programming language research. Numerous papers explain their advantages, how the operators explain each other (or don’t), and other aspects of the operators’ existence. Production programming languages, however, do not support these operators, partly because their relationship to existing and demonstrably useful constructs—such as exceptions and dynamic binding—remains relatively unexplored. In this paper,
In this paper, we report on our effort of translating the theory of delimited and composable control into a viable implementation for a production system. The report shows how this effort involved a substantial design element, including work with a formal model, as well as significant practical exploration and engineering.
The resulting version of PLT Scheme incorporates the expressive combination of delimited and composable control alongside dynamicwind, dynamic binding, and exception handling. None of the additional operators subvert the intended benefits of existing control operators, so that programmers can freely mix and match control operators.
Delimited Control in OCaml, Abstractly and Concretely System Description
"... Abstract. We describe the first implementation of multiprompt delimited control operators in OCaml that is direct in that it captures only the needed part of the control stack. The implementation is a library that requires no changes to the OCaml compiler or runtime, so it is perfectly compatible ..."
Abstract

Cited by 5 (1 self)
 Add to MetaCart
(Show Context)
Abstract. We describe the first implementation of multiprompt delimited control operators in OCaml that is direct in that it captures only the needed part of the control stack. The implementation is a library that requires no changes to the OCaml compiler or runtime, so it is perfectly compatible with existing OCaml source code and bytecode. The library has been in fruitful practical use for four years. We present the library as an implementation of an abstract machine derived by elaborating the definitional machine. The abstract view lets us distill a minimalistic API, scAPI, sufficient for implementing multiprompt delimited control. We argue that a language system that supports exception and stackoverflow handling supports scAPI. Our library illustrates how to use scAPI to implement multiprompt delimited control in a typed language. The approach is general and can be used to add multiprompt delimited control to other existing language systems. 1
A static simulation of dynamic delimited control
 HIGHERORDER AND SYMBOLIC COMPUTATION
"... We present a continuationpassingstyle (CPS) transformation for some dynamic delimitedcontrol operators, including Felleisen’s control and prompt, that extends a standard callbyvalue CPS transformation. Based on this new transformation, we show how Danvy and Filinski’s static delimitedcontrol ..."
Abstract

Cited by 5 (0 self)
 Add to MetaCart
We present a continuationpassingstyle (CPS) transformation for some dynamic delimitedcontrol operators, including Felleisen’s control and prompt, that extends a standard callbyvalue CPS transformation. Based on this new transformation, we show how Danvy and Filinski’s static delimitedcontrol operators shift and reset simulate dynamic operators, allaying in passing some skepticism in the literature about the existence of such a simulation. The new CPS transformation and simulation use recursive delimited continuations to avoid undelimited control and the overhead it incurs in implementation and reasoning.
CurryHoward Term Calculi for GentzenStyle Classical Logic
, 2008
"... This thesis is concerned with the extension of the CurryHoward Correspondence to classical logic. Although much progress has been made in this area since the seminal paper by Griffin, we believe that the question of finding canonical calculi corresponding to classical logics has not yet been resolv ..."
Abstract

Cited by 5 (1 self)
 Add to MetaCart
(Show Context)
This thesis is concerned with the extension of the CurryHoward Correspondence to classical logic. Although much progress has been made in this area since the seminal paper by Griffin, we believe that the question of finding canonical calculi corresponding to classical logics has not yet been resolved. We examine computational interpretations of classical logics which we keep as close as possible to Gentzen’s original systems, equipped with general notions of reduction. We present a calculus X i which is based on classical sequent calculus and the stronglynormalising cutelimination procedure defined by Christian Urban. We examine how the notion of shallow polymorphism can be adapted to the moregeneral setting of this calculus. We show that the intuitive adaptation of these ideas fails to be sound, and give a novel solution. In the setting of classical natural deduction, we examine the lambdamu calculus of Parigot. We show that the underlying logic is incomplete in various ways, compared with a standard Gentzenstyle presentation of classical natural deduction. We relax the identified
A Substructural Type System for Delimited Continuations
"... We propose type systems that abstractly interpret smallstep rather than bigstep operational semantics. We treat an expression or evaluation context as a structure in a linear logic with hypothetical reasoning. Evaluation order is not only regulated by familiar focusing rules in the operational sem ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
(Show Context)
We propose type systems that abstractly interpret smallstep rather than bigstep operational semantics. We treat an expression or evaluation context as a structure in a linear logic with hypothetical reasoning. Evaluation order is not only regulated by familiar focusing rules in the operational semantics, but also expressed by structural rules in the type system, so the types track control flow more closely. Binding and evaluation contexts are related, but the latter are linear. We use these ideas to build a type system for delimited continuations. It lets control operators change the answer type or act beyond the nearest dynamicallyenclosing delimiter, yet needs no extra fields in judgments and arrow types to record answer types. The typing derivation of a directstyle program desugars it into continuationpassing style.
Typed Dynamic Control Operators for Delimited Continuations
 FLOPS ’08: Proceedings of 9th International Symposium on Functional and Logic Programming
, 2008
"... Abstract. We study the dynamic control operators for delimited continuations, control and prompt. Based on recent developments on purely functional CPS translations for them, we introduce a polymorphically typed calculus for these control operators which allows answertype modification. We show that ..."
Abstract

Cited by 3 (2 self)
 Add to MetaCart
(Show Context)
Abstract. We study the dynamic control operators for delimited continuations, control and prompt. Based on recent developments on purely functional CPS translations for them, we introduce a polymorphically typed calculus for these control operators which allows answertype modification. We show that our calculus enjoys type soundness and is compatible with the CPS translation. We also show that the typed dynamic control operators can macroexpress the typed static ones (shift and reset), while the converse direction is not possible, which exhibits a sharp contrast with the typefree case.
A Systematic Approach to Delimited Control with Multiple Prompts
"... Abstract. We formalize delimited control with multiple prompts, in the style of Parigot’s λμcalculus, through a series of incremental extensions by starting with the pure λcalculus. Each language inherits the semantics and reduction theory of its parent, giving a systematic way to describe each le ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
(Show Context)
Abstract. We formalize delimited control with multiple prompts, in the style of Parigot’s λμcalculus, through a series of incremental extensions by starting with the pure λcalculus. Each language inherits the semantics and reduction theory of its parent, giving a systematic way to describe each level of control.
Constraining Delimited Control with Contracts
, 2013
"... Most programming languages provide abstractions for nonlocal control flow and access to the stack by using continuations, coroutines, or generators. However, their unrestricted use breaks the local reasoning capability of a programmer. Gradual typing exacerbates this problem because typed and unty ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
Most programming languages provide abstractions for nonlocal control flow and access to the stack by using continuations, coroutines, or generators. However, their unrestricted use breaks the local reasoning capability of a programmer. Gradual typing exacerbates this problem because typed and untyped code coexist. We present a contract system capable of protecting code from control flow and stack manipulations by unknown components. We use these contracts to support a gradual type system, and we prove that the resulting system cannot blame typed components for errors.