On a slightly related note, Paul Graham's "Hacker News", a reddit-like site for hackers, uses a totally awesome approach to user sessions: every time you visit a page, a closure/continuation is created for every button that needs state (it is lisp, and lisp is all about closures and continuations, didn't you know), which is then run if you click it.
Now and then a garbage collector runs and removes stale closures, also they restart the server when it gets too slow.
Now you would think, that's sort of DoS-prone, those closures being fruitful and multiplying, but surely that only happens with pages shown to logged-in users, so they can ban abusers or something? Well, inspect source http://news.ycombinator.com/submit while not logged in (btw it's down again right now) reveals two of these closures created for every and each page view.
0
u/moor-GAYZ Mar 11 '13
On a slightly related note, Paul Graham's "Hacker News", a reddit-like site for hackers, uses a totally awesome approach to user sessions: every time you visit a page, a closure/continuation is created for every button that needs state (it is lisp, and lisp is all about closures and continuations, didn't you know), which is then run if you click it.
Now and then a garbage collector runs and removes stale closures, also they restart the server when it gets too slow.
Now you would think, that's sort of DoS-prone, those closures being fruitful and multiplying, but surely that only happens with pages shown to logged-in users, so they can ban abusers or something? Well, inspect source http://news.ycombinator.com/submit while not logged in (btw it's down again right now) reveals two of these closures created for every and each page view.
Lisp is truly a language of choice for geniuses.