Why Lisp? Because it forces the s-expression narrow waist down everyone’s throats


Working with S-expressions takes discipline. It’s not easy, you can’t just lean on your language center and write words. Instead, you must put in work.

But why should you? Because narrow waists are exceptionally powerful, and reward that effort. It’s worth it. The layer below the narrow waist – the language – becomes cleaner, simpler. The layers above the narrow waist – the tooling, the editors, linters – gain leverage. They can do more.

Tools like Clerk can be built in userspace! How amazing is that!

Other solutions to the problems Clerk solve include:

  1. Build a proprietary programming language with proprietary libraries meant to be used in a proprietary editor (MATLAB)
  2. Build a separate editor for an existing language, forking the editor tooling ecosystem (Jupyter notebooks)
  3. Build a brand new programming language (Julia)

Note: I do not dislike MATLAB, Jupyter notebooks or Julia. I’m amazed by the problems they solve. I want to learn Julia. I’m just even more amazed by what you get when you sprinkle s-expression dust on ecosystem first and tackle the problem with those constraints in mind.

So why lisp? Because the fact that everyone is being forced to work with S-expressions is a good thing. It’s not easy. It requires effort. It requires discipline. But the leverage outweighs the cost.

In Clerk’s case, it didn’t have to create any rifts in the Clojure community. It communicates with the running Clojure process through a REPL, the standard way of communicating with Clojure processes. It doesn’t replace your editor, you can just use your editor. It does provide some surprises about expression evaluation: form-by-form evaluation is replaced with dataflow programming and dependency tracking. But that’s the thing that Clerk provides! That’s the value proposition! That’s the way you want to work with your Clerk notebook!

You can tell I like Clojure. I love Clojure. I enjoy working with Clojure systems more than I’ve enjoyed working with systems in other languages I’ve used. But this text is about Lisp, not Clojure. Clerk showed what is possible when your language is built with certain constraints in mind. I’m fairly confident it’s possible to make the same move in other languages: Common Lisp, Racket, Smalltalk. In fact, I’m fairly confident this has been tried. For instance, check out how the Glamorous Toolkit developers are approaching notebooks.

takeaways and actionables. I’ve been told I sometimes theorize without getting to the specifics. So here’s a list.

  1. Learn to work with s-expressions — it’s worth the effort.
  2. Try using Clojure, Clerk and Mathbox.cljs to visualize points in 3D, it’s amazing.
  3. Consider whether your current programming workflow limits the ideas you can explore and things you can build.

That’s it for today. Thanks for reading!