Browse thread
Native delimited continuations for bytecode OCaml
- Jacques Carette
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2006-02-28 (01:34) |
From: | Jacques Carette <carette@m...> |
Subject: | Native delimited continuations for bytecode OCaml |
[Posted for oleg@pobox.com] This message announces the native implementation of delimited continuation framework for byte-code OCaml. The framework supports `static' (shift/reset) and `dynamic' (prompt/control, shift0, control0) delimited continuation operators with multiple, arbitrarily typed prompts. The test file testd0.ml is a good example of using shift/reset in OCaml programs. The implementation is native: it copies a relevant fragment of the OCaml interpreter stack (The stack or its fragments are never inspected however). The implementation is efficient: only the necessary prefix of the stack is copied. The implementation is fully integrated with OCaml exceptions: exception handlers may be captured in delimited continuation (and re-instated when the captured continuation is installed); exceptions remove the prompts along the way. The implementation has no typing problems, no bizarre 'a cont types, and no use for magic. The implementation does no patching to the OCaml system and is a regular library. If you compile the top-level (see `make top'), you can use delimited continuation operators in interactive OCaml sessions. The library has been tested for OCaml 3.08, 3.09.0, and 3.09.1, on ia32 Linux and FreeBSD platforms. The current version is 1.6, Feb 7, 2006. The library is distributed under the MIT license. http://pobox.com/~oleg/ftp/packages/caml-shift.tar.gz