Scheme in Commercial Web Application Development [PDF]
untyped.com
untyped.com
I can't see a good way around this as long as the server keeps the continuations instead of offloading it to the client.
check to see if logged in; if logged in allow vote, else force login with a redirect;
And then you have to start from scratch after the redirect.
With continuations you can do this TRANSPARENTLY like this:
check to see if logged in and if not save my spot in the submit_vote computation, and "push" the login page; login and resume from where the login page was "pushed," thereby voting without redirecting and without restarting the computation.
Continuations captures state in a way very similar to closures. I think this is why the lisp/scheme crowd are so found of them. In contrast, the client-side-state-way appears procedural. I strongly believe that client side state is the _only_ worthwhile solution; We need to accept that fact and get rid of continuations.
It's not clear to me if you're joking, but in case you're not: there are some situations, especially in closed-system webapps, where it's useful to use a non-transparent scheme for resources. You don't want people to jump into a middle page of a survey or other workflow, and going out of your way to have the middle pages accessible via a RESTful scheme seems pointless and potentially misleading. Continuations or similar methods for papering over the "page" abstraction can be helpful, here. Even if you don't use something like that, you'll end up doing the same thing manually.
I agree, though, that those who use this style typically overuse it and apply it to situations (like, er, discussion forums... ;) where it isn't really appropriate.
Anyway, I am of course putting it a bit on the extreme end here, but in principle I stand by it. Continuations are but an elegant hack; I might prefer it over other similar hacks, but I'd rather not have to use it at all.
The site used to use them far more but because only the last N continuations were kept, at times of high load users would find the links on the page they were viewing broke on trying to use them; the fnid they referred to had disappeared because N more had been created since. One solution is to increase N. However, any trivial means of generating another M fnids means it's easy for a single attacker to cause N more to be generated.
As troels says, RESTful is the way to go. Continuation in my view are flawed for web apps. AIUI pg got away with it for Yahoo Store because they were only used in the shop design side of things where each shop owner could be given his own N storage of fnids, isolated from others.
It's been discussed before on here, in particular a post by me around end of April/start of May 2007 that caused pg to email me privately about thinking up new "ddos attacks". A while after that, most of the usage of fnids were replaced by conventional-style URLs so also some remain, M is smaller than it used to be.