We are seeking comments on the final draft of our ICFP 2006 paper:
Delimited dynamic binding, by Oleg Kiselyov, Chung-chieh Shan, and Amr Sabry.
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 ill-defined 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 reduction-preserving translation from DB+DC to DC,
which proves that delimited control macro-expresses 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.
The paper comes with a large amount of
accompanying code—in Scheme, OCaml, SML, and Haskell. The code (described in the paper's appendix) uses realistic examples to show how the joint behavior of delimited continuations
and dynamic binding is ill-defined in various PL systems, and solves the problem by a
full-fledged implementation of dynamic binding in all these systems. Any comments or suggestions would be very welcome!
Recent comments
13 weeks 2 days ago
13 weeks 3 days ago
13 weeks 3 days ago
35 weeks 4 days ago
39 weeks 6 days ago
41 weeks 3 days ago
41 weeks 3 days ago
44 weeks 1 day ago
48 weeks 5 days ago
48 weeks 5 days ago