handwritten.danieljanus.pl

Clerkenwell: A handwritten Clojure notebook

Remember Edsger, a handwritten REPL for the reMarkable 2 that I had shared a couple of months ago? Today, I’d like to present another variation on the “things appearing automatically on your e-paper tablet” theme. However, unlike Edsger which was an experiment / proof of concept / artistic manifesto, I find this new software remarkably practical. So much so, in fact, that I’ve been using it on an almost-daily basis for the past few weeks.

It’s called Clerkenwell. It’s probably easiest to understand it by seeing it in action:

Think a computational notebook — a mixture of code, prose and images, like Jupyter or Wolfram Notebook — except your main means of expressing your thoughts is an e-paper tablet and a stylus. You write down your trail of thought; you think on paper (presumably about some piece of code, or about a math problem).

But! The tablet is connected to a Clojure REPL running on your computer in Emacs. You can evaluate stuff in Emacs and have the result appear automatically on e-paper. You can render the result as raw data, as an image, a table, a plot, or formatted Markdown — whatever makes sense. And conversely, anything you scribble on tablet automatically gets rendered and shown in Emacs.

I won’t go into the details of how to use it (I refer you to the documentation for that). Instead, let me briefly talk about…

Background

I’ve always enjoyed handwriting (even though I don’t write in cursive and my penmanship is mediocre). It’s an activity that I find pleasing tactilely and intellectually. I keep a paper journal, an assorted bunch of paper notebooks on various topics, and I have a stock of blank ones that should last me a thousand years or so.

Long ago, I discovered that a pen and paper can help me unblock my thoughts in a way no text editor can. This has to do with it being an inherently single-tasking environment. It still holds true for me (even more so now in light of my ADHD diagnosis), and I was glad to find out that the reMarkable retains that focused quality.

Several weeks ago, I was scribbling on the reMarkable, trying to understand how some code worked. I found myself keeping a REPL session next to the notebook, to check some low-level details. At one point, I observed myself copying Clojure expressions and their results into the notebook, by hand. That doesn’t really make sense, I thought. “There must be a better way. Surely I can leverage some Edsger code to hack up something working.”

So I started discussing it with Opus, and ended up with…

Subversive slop

The ‘slop’ part is obvious. If you look at the code, it’ll be immediately apparent that it wasn’t written by a human: it has all the usual traits of being LLM-generated. It’s verbose, peppered with comments written in hard-to-ingest LLM-ese, laden with tests of dubious value, and feels somewhat over-engineered. Oh, and it mostly works.

I still cringe at it. I have a personal rule about slop: it has to justify its existence. So what’s my justification of Clerkenwell?

Well, it’s about what I’m using it for: to study how software works.

In the LLM-revolutionized world, it has become possible — and sometimes viable — to outsource your thinking to the machine. Some people seem content with telling the LLM what they want, and then not caring, not just about how the output works, but also what exactly it does or what the tradeoffs of the LLM’s decisions are.

This is what I deeply disagree with. Every time I generate some slop I don’t understand or understand only partially (Clerkenwell included), I feel uneasy. I picture myself as incurring comprehension debt — and I intend to pay that debt off. Because I value accountability and responsibility. Because I want my code to be really mine so I can vouch for it. Because I don’t want my mechanism-understanding muscles to atrophy. And, above all, because the need to understand is part of who I am. I still care about code. How could I not care?

Hence the term „subversive”. Instead of encouraging churn and banging out feature after feature at inhuman speed, Clerkenwell encourages slowing down. Take the hammock time you need. Go to a coffee shop or a library. Disconnect from the Internet. Set it up over an ad-hoc network instead. Enjoy the thinking.

Clerkenwell in a coffee shop
It pairs nicely with my GPD Micro PC.

It can even be used to look into itself. I expect it to become less sloppy and simpler over time. I want to pay off the debt.

Going forward

Clerkenwell already does pretty much everything I want it to do. So I don’t envision myself adding many more features, unless there’s a dire need. (In contrast, features may be removed if they don’t prove useful.)

However, I very much want to increase the outreach. If there’s interest, I’d like to port Clerkenwell to more devices, even at the cost of increasing complexity or temporarily incurring more debt. It would also be awesome to extend it to more backends than just Clojure. Perhaps it could speak the Jupyter kernel protocol? Or leverage the language-agnosticity of nREPL? The possibilities are legion.

Meanwhile, if you use Clerkenwell, let me know. If you’re in Warsaw, I invite you to Clojure Warsaw #1 where I’ll be doing a live demo and talking about it more!