3 ms·
PG and friends are using Continuations ( http://en.wikipedia.org/wiki/Continuation http://en.wikipedia.org/wiki/Continuation ), which are supported first-class
by bri3d 14y ago
PG and friends are using Continuations ( http://en.wikipedia.org/wiki/Continuation http://en.wikipedia.org/wiki/Continuation ), which are supported first-class in Racket, as the pattern underlying HN.
Their specific implementation of continuations means that each time a page is generated, each user-specific/authenticated link off of the page (Flag, Voting, Delete) is evaluated as a possible continuation of the user's state and the user-and-action specific hash "fnid" (Function ID) is cached and interpolated into the HTML.
Hence, the hash absolutely changes for every logged-in user every page load.
Lots of older sites still use continuations to great effect; Continuations were popular in the WebObjects days but since they require lots of user state information to be stored server-side they're comparatively difficult to scale.
Continuations are a really cool pattern to study, since most hacking in HTTP-backed web services comes from the inherently stateless nature of the protocol, and continuation-based programming helps prevent the inverted control flow that page-based programming lends itself to.