Andrew Tropin · @abcdw
633 followers · 1193 posts · Server fosstodon.org

Continuations Brief Summary. Studied the topic a bit and brought you a write-up. Should be interesting for people related to programming, and especially for scheme and lisp users.

trop.in/blog/continuations-bri

#programming #scheme #lisp #clojure #commonlisp #callcc #continuation

Last updated 1 year ago

Ramin Honary · @ramin_hal9001
192 followers · 1822 posts · Server emacs.ch

I've been learning about Delimited Continuations lately, because I have recently learned that several programming language theory heavyweights, including Oleg Kiselyov, now believe the classic continuation control construct, e.g. "call/cc" in the language, were big mistake that make program optimization needlessly difficult, though I don't fully understand why this would be the case. Unfortunately, "call/cc" is encoded in the Scheme language standard, so compiler authors need to come up with work-arrounds -- who knew at the time of the first revision (1975) it would be a bad idea?

Delimited Continuations solve the problems inherent in continuations (again, I don't understand why), and are *composable,* meaning it is easy to write modular pieces of code using continuations in isolation that can all be made to fit nicely together with a few simple high-order functions.

So fortunately for me, there is already a good implementation, so I can probably figure it all out by just reading the code and studying the type definitions: hackage.haskell.org/package/CC

Here is the research paper by R. Kent Dybvig, Simon Peyton Jones, and Amr Sabry describing the implementation: legacy.cs.indiana.edu/~sabry/p

Here is a primer on Delimited Continuations which I found helpful: gist.githubusercontent.com/seb

#scheme #haskell #plt #callcc

Last updated 2 years ago