Results 1 -
5 of
5
Trampolined Style
- IN INTERNATIONAL CONFERENCE ON FUNCTIONAL PROGRAMMING
, 1999
"... A trampolined program is organized as a single loop in which computations are scheduled and their execution allowed to proceed in discrete steps. Writing programs in trampolined style supports primitives for multithreading without language support for continuations. Various forms of trampolining all ..."
Abstract
-
Cited by 34 (3 self)
- Add to MetaCart
A trampolined program is organized as a single loop in which computations are scheduled and their execution allowed to proceed in discrete steps. Writing programs in trampolined style supports primitives for multithreading without language support for continuations. Various forms of trampolining allow for different degrees of interaction between threads. We present two architectures based on an only mildly intrusive trampolined style. Concurrency can be supported at multiple levels of granularity by performing the trampolining transformation multiple times.
Revisiting Coroutines
, 2004
"... This paper defends the revival of coroutines as a general control abstraction. After proposing a new classification of coroutines, we introduce the concept of full asymmetric coroutines and provide a precise definition for it through an operational semantics. We then demonstrate that full coroutines ..."
Abstract
-
Cited by 5 (1 self)
- Add to MetaCart
This paper defends the revival of coroutines as a general control abstraction. After proposing a new classification of coroutines, we introduce the concept of full asymmetric coroutines and provide a precise definition for it through an operational semantics. We then demonstrate that full coroutines have an expressive power equivalent to one-shot continuations and oneshot partial continuations. We also show that full asymmetric coroutines and one-shot partial continuations have many similarities, and therefore present comparable benefits. Nevertheless, coroutines are easier implemented and understood, specially in the realm of procedural languages. Finally, we provide a collection of programming examples that illustrate the use of full asymmetric coroutines to support direct and concise implementations of several useful control behaviors, including cooperative multitasking.
A Portable Implementation of First-Class Continuations for Unrestricted Interoperability with C in a Multithreaded Scheme
, 2000
"... The implementation of rst-class continuations in a Scheme system that interfaces to a stack-based language such as C is dicult when Scheme and C frames can be interleaved (i.e. Scheme and C can nest calls to each other arbitrarily) . Such a situation occurs when using a combination of callbacks, hig ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
The implementation of rst-class continuations in a Scheme system that interfaces to a stack-based language such as C is dicult when Scheme and C frames can be interleaved (i.e. Scheme and C can nest calls to each other arbitrarily) . Such a situation occurs when using a combination of callbacks, higher-order functions, exception processing, and a Scheme level thread system built on top of rst-class continuations. We show that in this context the use of C threads to implement rst-class continuations allows unrestricted interoperability with C. 1 Introduction Scheme systems that allow linking with C code (and more generally any stack-based language) whether they generate native code or C code, require special treatment of continuations when Scheme continuation frames and C frames can be interleaved. In our examples we will denote continuations with a string of letters; C frames are in upper-case, Scheme frames are in lower-case, and the last frame added to the continuation is on the...
An Alternative Approach to Initializing Mutually Referential Objects
, 2005
"... Mutual dependencies between objects arise frequently in programs, and programmers must typically resort to manually filling “initialization holes ” to help construct the corresponding object graphs, i.e. null values and/or explicitly mutable locations. This report describes a “base-line ” proposal f ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
Mutual dependencies between objects arise frequently in programs, and programmers must typically resort to manually filling “initialization holes ” to help construct the corresponding object graphs, i.e. null values and/or explicitly mutable locations. This report describes a “base-line ” proposal for a generalized form of value recursion in an ML-like language called initialization graphs, where value recursion is given the simplistic semantics of a graph of lazy computations whose nodes are sequentially forced, with uses of recursive values checked for initialization-soundness at runtime. We then develop examples using this mechanism to show how problematic the issue of value recursion is for ML-like languages, and in particular how sophisticated reactive objects cannot be defined in the language without using initialization holes, and how this forces ML programmers to break abstraction boundaries. At the same time we show how OO languages rely extensively on null pointers during initialization. We propose that a general, semi-safe mechanism allows value recursion to be used in conjunction with existing sophisicated abstract APIs such GUI libraries, and allows freshly defined APIs to be both abstract and yet not require clients to use explicit initialization holes. We propose that the initialization mechanism permits more programs to be expressed in the mutation-free fragment of ML, though we do not formally prove this result. 1
Delimited Control in OCaml, Abstractly and Concretely Oleg Kiselyov
"... We describe the first implementation of multi-prompt 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 run-time, so it is perfectly compatible with exist ..."
Abstract
- Add to MetaCart
We describe the first implementation of multi-prompt 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 run-time, so it is perfectly compatible with existing OCaml source and binary code. The library has been in fruitful practical use since 2006. 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 multi-prompt delimited control. We argue that a language system that supports exception and stack-overflow handling supports scAPI. With byte- and native-code OCaml systems as two examples, our library illustrates how to use scAPI to implement multi-prompt delimited control in a typed language. The approach is general and has been used to add multi-prompt delimited control to other existing language systems.

