Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The FAQ doesn't mention anything about this -- can you explain how Seaside uses continuations?


It uses continuations to hide the asynchronous nature of web requests and allows the flow between pages of a web app to be written in an imperative style.

"Inverting back the inversion of control" describes the idea (in Scheme) https://pages.lip6.fr/Christian.Queinnec/PDF/www.pdf

Paul Graham used the idea in ViaWeb - and apparently got a patent on some aspect of it https://web.archive.org/web/20060323211251/http://paulgraham...


There are a couple of continuation-based web frameworks for Ruby (Borges, Wee), but they're old and abandoned as far as I know.

I suspect it didn't catch on because (1) people are afraid of continuations, and (2) web apps are typically designed in at least a pseudo-REST-like style, so the paradigm of "asking" the user (like "await" in ES6) isn't needed very often.

But it's a cool thing to be able to do, especially for funnel-type flows, and other types of more complex session-based interactions.

I wonder if there are any JavaScript inversion of control things for client side code. I've been working for the past week on a signup funnel with React and Flux, and it's just a big explicit state machine... which kind of works, but is also kind of tedious.


I think 'Ajax' killed continuation based web servers. See Avi Bryant's thoughts in this area from back then: https://web.archive.org/web/20060610180033/http://smallthoug...

There were client side JavaScript continuation like things. Back in the mid-2000's there was Narrative JavaScript. I used it to implement threads and Alice ML style futures/promises on the client side: https://bluishcoder.co.nz/2006/06/05/more-concurrency-in-nar...


There's also Nagare in Python: http://www.nagare.org/trac/wiki/NagareTutorial

IIRC it uses Stackless Python, not the standard interpreter, and I don't know how active its development is.


IIUC HN uses them too.




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

Search: