Hacker News new | past | comments | ask | show | jobs | submit login

> If you read the source of HN, you'll see that it doesn't actually use continuations.

> It had to be some dialect of Lisp with continuations, which meant Scheme, and MzScheme seemed the best.

(From further down the page).

I'm confused. What needs continuations?




I just wanted to have them in the language. The fact that I don't currently use them in HN doesn't mean they're useless.


ah ok thanks for clarifying.


I always thought the purpose of Arc was to be cruft-free, "don't include it unless it is actually needed".


Errors/exceptions, for one, are implemented using continuations.


Sounds terribly inefficient to me, but what do I know -shrug-


All control flow is a subset of continuations. The stack is a continuation (calling a function is call-with-current-continuation, return is just calling the "current continuation"), loops are continuations (with the non-local control flow, like break/last/redo/etc.), exceptions are continuations (like functions, but returning to the frame with the error handler), etc. Continuations are the general solution to things that are normally treated as different. So continuations are just as efficient (or inefficient) as calling functions or throwing exceptions.

In a web app context, though, it's kind of silly to keep a stack around to handler something like clicking a link that returns the contents of database row foo. People do this, call it continuations, and then run into problems. The problem is not continuations, the problem is that you are treating HTTP as a session, not as a series of request/responses. (The opposite of this style is REST.)


In theory yes, in practice you need to reify the stack (even for one-shot continuations). Clinger, Hartheimer and Ost have a really good survey paper of the different ways to do that:

http://www.scribd.com/doc/47221367/Clinger-Implementation-St...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: