Continuation Fest 2008

April 13, 2008
Tokyo, Japan

http://logic.cs.tsukuba.ac.jp/Continuation/

Abstracts

"Typing printf" by Kenichi Asai (Ochanomizu)

The number of arguments the printf function accepts varies according to the number of directives (such as %d and %s) in the first string argument. Thus, the type of printf appears to require a dependent type. Contrary to this intuition, Danvy showed a type-safe printf in ML without any help of dependent types. In this talk, I first review the role of continuations in his solution. Then, I demonstrate that the solution becomes extremely simple if we use the delimited continuation constructs, shift and reset. Finally, I show some subtle points in typing printf.

"Demo of persistent delimited continuations in OCaml for nested web transactions" by Oleg Kiselyov (FNMOC)

We demonstrate persistent delimited continuation library for bytecode OCaml programs. The captured delimited continuations can be stored on disk, to be later loaded and resumed in a different process. The library works with the unmodified OCaml system as it is.

We demonstrate that the library makes writing web applications (CGI scripts) as straightforward as writing interactive console applications using read and printf. The output of course can be arbitrarily complex HTML, XML, etc. In particular, our code can take advantage of regular lexical scope for (mutable) temporary data, rather than having to explicitly read and write them via a request object. The use of continuations lets us avoid loops in the code, relying instead on the `Back button.' Delimited continuations naturally support `thread-local' scope and are quite compact to serialize.

Delimited continuations help us implement nested transactions. In a live demo we show that a user may repeatedly go back-and-forth between editing and previewing their blog post, perhaps in several windows. The finished post can be submitted only once.

"Various use of continuations in Kahua - Application in practical web programming experience -" by Katsutoshi Itoh (Kahua project)

Kahua is a continuation passing style (CPS) application framework and server, in which we have developed and been serving several practical web applications.

From our experience we implemented number of higher-level APIs that wraps different aspects of continuations to capture the common idioms in web-application programming. Using them makes web-application development much easier than using bare call/cc and shift/reset primitives. In this presentation, we explain the implementation and usage of them, based on actual examples we encountered during the development.

Spearker's profile: Katsutoshi Itoh is a member of Kahua project since 2005.

"Delimited Continuation in the Grammar of Japanese" by Rui Otake (Tohoku)

A natural language expression can be represented as a kind of program. Any such program, if well-formed, can be evaluated in different domains such as orthography, phonology, and semantics. The resulting values are the spelling, pronunciation and meaning, respectively, of the grammatical expression of the language the program represents.

From this viewpoint, I will illustrate the use of delimited continuation in analyzing sentences in Japanese. In particular, the meaning of question words such as ï (dare) and (nani) involve shift operator, and that of (mo) and (ka) function as reset.

"Continuations for video decoding and scrubbing" by Conrad Parker (Kyoto)

Playback of encoded video involves scheduling the decoding of audio and video frames and synchronizing their playback. "Scrubbing" is the ability to quickly seek to and display an arbitrary frame, and is a common user interface requirement for a video editor. The implementation of playback and scrubbing is complicated by data dependencies in compressed video formats, which require setup and manipulation of decoder state.

We present the preliminary design of a continuation-based system for video decoding, reified as a cursor into a stream of decoded video frames. Frames are decoded lazily, and decoder states are recreated or restored when seeking. To reduce space requirements, a sequence of decoded frames can be replaced after use by the continuation which created them. We outline implementations in Haskell and C.

"Continuing from the Past: An Approach to Building Dynamically Upgradable Applications" by Takuo Watanabe (Tokyo Institute of Technology) and Yuichi Tanaka (Cybozu Inc.)

We propose an architecture that enables applications to be updated without stopping/restarting their execution. The key idea is that the continuation at the upgrade time is saved and then used to re-construct the new execution state of updated (replaced) code. On regenerating the new state, the function corresponding to each frame within the saved continuation is re-invoked in order to recover its 'past' execution. We used this technique to implement a simple dynamically upgradable Scheme based web application.

"How to implement continuation only language in gcc 4.x" by Shinji Kono (Ryukyu)

We have implemented Continuation based C (CbC) in gcc 4.x. We'd like to show how easy to implement continuation only language in gcc compiler. We found some many codes are spent to detect the reason why we cannot do tail call optimization. Since we implement CbC in RTL code generation level, it should be architecture independent. But there are some exceptions. We also discuss about application of CbC complier on a many core architecture.

"Ruby Continuation" by Koichi Sasada (Tokyo)

Programming Language Ruby has a Continuation class and a callcc method. In this presentation, we introduce history, current situation (on Ruby 1.9) and the future of Ruby's continuation.

Profile: Koichi Sasada is one of the developer of the Ruby interpreter. His Virtual Machine was merged with Ruby 1.9 which is released at Dec/2007.


Organizers: CF2008@logic.cs.tsukuba.ac.jp