clojure-europe

simongray 2026-02-17T07:24:56.446619Z

good morning

Ludger Solbach 2026-02-17T07:28:22.019989Z

Good morning, too

thomas 2026-02-17T07:52:50.139789Z

mogge

mdiin 2026-02-17T07:59:53.208789Z

Good morning 🧊

2026-02-17T08:20:35.321159Z

morning

2026-02-17T08:43:17.282869Z

Morning

dharrigan 2026-02-17T08:51:26.834809Z

Good Morning!

eaj 2026-02-17T08:55:50.490229Z

Good morning!

ray 2026-02-17T15:05:55.998499Z

good morning

teodorlu 2026-02-17T15:50:58.693769Z

Morning!

teodorlu 2026-02-17T15:52:26.122909Z

I'm starting to believe that inventing a light hypermedia protocol is a good idea to avoid writing Emacs lisp, and write Babashka instead. If that's a bad idea, I might need some telling.

teodorlu 2026-02-21T09:52:21.567179Z

I needed a little time to gather my thoughts here 😅😄 And the response turned out lengthy anyway. My ideas about this are still quite fuzzy. My need for this stems from a couple of observations. I've made several one-off Emacs Lisp scripts that do a little thing in my projects. For example creating new pages on my website, and creating links to pages on my website. They are great — they get me a step towards a more interactive experience working on my source. However, (a) I loose track of which UI's I've made, (b) the source of these tiny Emacs Lisp UIs know a great deal about which Babashka tasks / scripts they have to call. In the end, I forget about them, or I make changes to the code and they suddenly stop working. I change the Babashka side, and the Emacs side stops working. I can't cover client side logic with Babashka/Clojure tests. This sounds terribly similar to the problems one gets with the server in one language (eg PHP) and a Javascript bundle that knows a lot (too much) about server internals. On the web, we have a solution to this, hypermedia. The server knows the domain model and the logic, and the client focuses on hypermedia controls only. So let's do a little exaptation. Babashka is the server, and Emacs Lisp is "just" a dumb hypermedia client. My first version would need (a) an input text control, (b) a select between options control, and (c) a way to display a message. I think the central design problem here is the hypermedia protocol. I want it to be EDN centric, but clients shouldn't care about EDN. My draft is this:

EDN_HEADER\n
\n
CONTROL_1
CONTROL_2
Where each control is a tab separated list. Input text control:
:input{:action :set-name}What is your name?
Select between options control:
:option{:action :set-site :site/url ""}Wikipedia
:option{:action :set-site :site/url ""}Lu Wilson's Wikibloggarden
I haven't yet drafted the text that should be sent from the client back to the server. --- The funny feeling I've got is, this seems sort of obvious, so why haven't anyone made it already? I guess Babashka is kind of young. And essential, to provide EDN-niceness. We don't want to wait for a JVM process startup between each UI choice. But Babashka is definitely fast enough. And with Invoker (https://github.com/filipesilva/invoker), we get a hook from Babashka into our running JVM process. The future of my many throwaway Emacs Lisp scripts, I hope, is to have the logic move to the server as small state machines, and a generic hypermedia-bb Emacs library that provides the UI controls without caring about opaque EDN strings that it just helps carry.

borkdude 2026-02-21T09:54:53.047449Z

you could just use the nREPL client/server architecture directly maybe?

teodorlu 2026-02-21T09:56:38.218709Z

Good question. I don't know quite how that works, I'll have a look!

borkdude 2026-02-21T09:58:06.175899Z

I mean if you want to have some kind of RPC you may just want to startup a babashka nrepl and talk to it through nrepl.el or whatever

teodorlu 2026-02-21T10:00:09.529219Z

And the advantage of building on nREPL is that I don't have to invent a protocol? It would require that the client knows "how to speak nREPL", which Emacs (nrepl.el) and Babashka/JVM Clojure already do.

2026-02-22T07:06:10.903659Z

I built an emacs loadable module with sci in it awhile ago so I could just write emacs stuff in-process using Clojure. It didn't end up feeling better to me than just writing things in elisp.

teodorlu 2026-02-22T07:44:22.336959Z

Scimacs, I presume?

👍 1
teodorlu 2026-02-22T07:46:23.058199Z

Lack of Emacs experience is likely a factor. I'm just not as comfortable as I am with Clojure.

2026-02-19T05:16:47.860489Z

Say more.