Live data from Hacker News

Writing a Lisp: Continuations

reinvanderwoerd.nl

1–10 of 51 posts

Re: Writing a Lisp: Continuations

#3

Do any non-Lisp/Scheme languages have continuations?

Wikipedia provides a list of continuation implementations in a variety of languages:

https://en.wikipedia.org/wiki/Continuation#Programming_langu...

Some of these are first-class continuations; others support continuation passing style.

Re: Writing a Lisp: Continuations

#5
post #3

Do any non-Lisp/Scheme languages have continuations?

Wikipedia provides a list of continuation implementations in a variety of languages: https://en.wikipedia.org/wiki/Continuation#Programming_langu... Some of these are first-class continuations; others support continuation passing style.

As an example, here's a simple proof-of-concept webapp I wrote in Ruby, based on continuations:

https://github.com/nathell/ruby-continuation-webapp

Re: Writing a Lisp: Continuations

#7

Do any non-Lisp/Scheme languages have continuations?

There's lots of continuation styles & libraries, but most are delimited continuations.

In my opinion, delimited ones are far cleaner to implement and to work with than the more universal continuations of Scheme. call/cc, as a product of Scheme's efforts on simplicity[1], has to encompass a larger amount of low-level state than most real-world uses of it use (and it's used far less frequently in "real applications" than academically). Having a better suite of flow control forms and keeping continuations delimited has far less constraints on the design of the runtime and leads to more focused and explicit operation without a bunch of implicit unused implications hanging around.

[1 = simplicity as in fewer built-in operations]

Re: Writing a Lisp: Continuations

#8

Do any non-Lisp/Scheme languages have continuations?

The Rhino javascript implementation has continuations. Chris Double once stuck it in Jetty, and I threw together a horrifying proof-of-concept Seaside-like continuation-based web programming library based on that: http://homepages.kcbbs.gen.nz/tonyg/lshift_archive/a-rhino-a...

As a proof-of-concept, it was fun, but that's as far as it went :-)

Re: Writing a Lisp: Continuations

#10

Do any non-Lisp/Scheme languages have continuations?

I wonder how it could affect the performance of a interpreter if is build around (internal) continuations, so all the other cool things as exceptions are made on top of it.

I try a small demo, and the complexity of the interpreter get high fast.

Also, if not continuation, what else can be used?

Post reply on HN