Yield : Mainstream Delimited Continuations; "yield" from different languages compared and formalized

Yield : Mainstream Delimited Continuations (PDF), by Roshan P. James and Amr Sabry, TPDC 2011

Many mainstream languages have operators named yield that share common semantic roots but differ significantly in their details. We present the first known formal study of these mainstream yield operators, unify their many semantic differences, adapt them to to a functional setting, and distill the operational semantics and type theory for a generalized yield operator. The resultant yield, with its delimiter run, turns out to be a delimited control operator of comparable expressive power to shift-reset, with translations from one to the other. The mainstream variants of yield turn out to be one-shot or linearly used restrictions of delimited continuations. These connections may serve as a means of transporting ideas from the rich theory on delimited continuations to mainstream languages which have largely shied away from them. Dually, the restrictions of the various existing yield operations may be treated as shift-reset variants that have found mainstream acceptance and thus worthy of study.

I found this work interesting on two different aspects : first, the link between yield and delimited continuations, if not particularly surprising, is nice, and I hope it will interest the participants to the recent delimited-continuation-rage on LtU. I have actually found this paper in one recet LtU thread, but consider it deserve its own topic.

Secondly, I like the idea of comparing related features of different programming languages in a precise, formal way, that is by expressing them all in a common theoretical framework. I would be interested in more references to similar work, for completely unrelated features. After a very quick googling, I found blog posts that partially display similar ambition, such as Comparing Java and C# Generics by Jonathan Pryor, 2007 -- I'm still unsatisfied though, I think generics would make for a very good target for cross-languages comparisons.

The present paper has been mentioned in a few places on the web (two Hacker News thread, one posting on a Mozilla mailing-list), but not generated any discussion that I noticed. You may be interested, however, on the plans for future work of the same authors detailed for a recent workshop, Oleg implementation of yield on top of its Delimcc Ocaml library, and, for those that need to know whether it's a left or right Khan extension to grasp a notion, The Comonad.Reader reconstruction of the paper.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

The link is missing!

The link is missing!

Thanks, fixed.

Thanks, fixed.

It is preferable to use futures instead of "yield"

It is preferable to use futures instead of "yield" for reasons of clarity and sometimes efficiency. See Actor Model of Computation: Scalable Robust Information Systems.

What on that site supports your claim?

What on that site supports your claim?