I gave up trying to figure out how to use continuations for web programming.
Racket looks amazing. You want to do web development in it. But the official discussions steer quickly into continuations. And you hit a wall. Sure, you’re willing to learn some new things to get into Racket, but come on. Continuations are weird.
Even if you do see the point of continuations, in the abstract, you’re not clear on how useful they’d be for web programming in particular.
You’ve given up trying to make sense of them. You gave it your best, but you just don’t get it.
It doesn’t have to be like this.
Continuations seem to require a new mindset. But how to acquire it? The tutorials don’t give you that. You’ve never seen anything like that before. The docs don’t explain how to think about this stuff. They just throw you into the deep water.
You’ve pretty much abandoned the idea of continuations for web devel. You’re about to chuck out Racket as something that would have been cool. Paul Graham said that Lisp was his secret weapon for web devel, but if this is what he’s talking about, well, that’s just nuts.
What if you could determine your application state automatically? Request comes in and you know just where you are in that big state machine of yours.
Whereas most web developers bring knives (or maybe just spoons, toothpicks, and a dollop of good intentions) to the HTTP application state management brawl, you don’t need any weapons at all. Like Neo in The Matrix, you see continuations everywhere. There’s no need to suss things out using cookies, ad hoc query parameters, and multiple databases. You skip that fight entirely and proceed directly to GO.
send/suspend/dispatch with elan.
REST and that elusive HATEOAS come for free. Not only can you see the past, continuations let you kinda-sorta see into the future, too.
Even if you don’t end up using continuations in your web work, they’ll change the way you look at the web and think about HTTP. For the better.
A Short Introduction to Web Programming with Continuations in Racket is a guide to using continuations for the web with the Racket HTTP server and its language for stateless HTTP server programming.
You’ll understand what continuations are all about and how they make REST and allied concepts like HATEOAS automatic.
Here’s what you’ll pick up and master:
#lang web-server, the stateless web server language.
This book is currently being developed and is available for pre-sale: