Why isn’t Lisp more widely used in web development?

You’d love to make a site in Racket, the hottest Lisp out there. The Racket developers have built up a truly impressive system that’s a real pleasure to use.

All the ingredients appear to be there:

Built in web-server? Check.

High-quality, thorough documentation? Check and check.

A Lisp that feels like it comes from the future? Oh yeah.

But there’s precious little guidance out there on how to make real-world web sites with the Racket web server.

Sure, the official documentation contains a handful of simple examples. They’re a good start. But you’re not sure how to move from them to making a more complex site. There’s a big gap.

Maybe you start to suspect that Racket’s HTTP server is just a fancy toy.

Maybe you’ve even given up on the idea of hacking the web in Lisp.

That would be a real shame, because the Racket web server—while fairly lean compared with other web frameworks out there—is a powerful and flexible.

And when you combine Racket’s HTTP server with the cutting-edge features of Racket, we’re talking about a system that web developers can drool over.

Even if you’re new to the web, Racket’s direct approach gives you a delightful way to dip your toes in without getting bogged down in a bazillion different frameworks and dependencies.

Enter Server: Racket

Server: Racket is an ebook all about real-world web development with the Racket HTTP server. In this ebook, you will learn how to make real-world web sites using the built-in Racket HTTP server.

We will build up a full-fledged site, step-by-step, and find out how to solve problems that the official documentation doesn’t talk about (not in detail, anyway, and not in any full-length tutorial).

We’ll dig in to these web development topics and see how to deal with them in Racket.

Part 1: HTTP à la Racket

Working with HTTP requests and responses entirely within Racket: no external systems, and using only modules that come standard with Racket.

  1. The servlet: In the beginning there was request?response?
  2. Routes: URL-based dispatching
  3. Error handling
  4. Logging
  5. Working with JSON data
  6. HTML templates
  7. Processing HTML forms
  8. Handling AJAX requests
  9. Cookies
  10. Testing

Part 2: Interacting with other systems

Where we begin to connect to specialized systems running outside of Racket and use specialized packages that aren’t included in a standard Racket installation.

  1. Using a relational database (db, sql)
  2. Session management (redis)
  3. Environment variables (dotenv)
  4. JSON Schema validation (argo)
  5. Models (object-relational mapping) (racquel)
  6. Sending HTTP requests (http)
  7. Caching with memcached (memcached)
  8. Database migrations with Phinx
  9. Racket and Docker
  10. A CRUD-style HTTP API
  11. Deploying a Racket site behind a proxy server

The ebook is organized as a set of HTML files for each chapter, with Racket starter code—fully functioning mini-sites—illustrating how these topics can be tackled with Racket.

Get your copy

Use the button below to get the ebook:

Get Server: Racket

About the author

I’m Jesse Alama. I’ve been hacking Scheme and Lisp since 1996. And I love building web sites. I’m a full-stack developer by day. (And by night, too.) I write about these topics over at lisp.sh. I’ve written the Argo package (JSON Schema validator for Racket). I’m the author of the entry on the lambda calculus in the Stanford Encyclopedia of Philosophy and have worked as a researcher in mathematics and computer science, primarily in automated theorem proving.

In my view, Lisp has a lot of potential for shaping how we develop for the web. The flexibility and power of Lisp is well-suited to taking on the web’s thorny problems.

I’m happy to share with you what I’ve learned so far about making web sites using Racket, a truly world-class Lisp.