nrepl

jeaye 2026-02-16T20:44:19.778899Z

Hey folks! jank has gained an nREPL server, written in jank. 🕺 I'd like to get an idea about testing it, so I've been looking around for a standard test suite for nREPL servers. Does such a thing exist? If not, should it? I found a three year old discussion https://github.com/nrepl/nrepl/discussions/273, wherein @borkdude offered to spin such a thing up. Rather than necro-post there, I'm asking here; if you'd rather me post on that old Discussion, just let me know.

👏 4
👀 1
dpsutton 2026-02-16T20:45:32.540389Z

are there plans for a socket server?

jeaye 2026-02-16T20:47:36.267569Z

What do you mean socket server, Dan? nREPL uses TCP sockets. 🙃

dpsutton 2026-02-16T20:49:18.152179Z

i mean like clojure offers:

❯ clj -J-Dclojure.server.repl="{:port 5999 :accept clojure.core.server/repl}"
Clojure 1.12.1
user=>
and then
❯ netcat localhost 5999
user=> (+ 1 1)
2

jeaye 2026-02-16T20:51:16.720229Z

Ah, gotcha. Not currently slated. My understanding is that nREPL is the de facto REPL protocol for Clojure, by community usage, so I'm aiming for best bang for buck here.

dpsutton 2026-02-16T20:52:20.601269Z

that’s certainly true. There is some magic to a repl that doesn’t require the main entrypoint though. Maybe in the future

jeaye 2026-02-16T20:53:12.123319Z

Yep, there's no reason that lib can't be ported to jank. Even today, that's doable!

bozhidar 2026-02-18T15:06:49.214709Z

It doesn’t exist yet, but it’s the cards for this year.

bozhidar 2026-02-18T15:08:18.349919Z

The main problem was the we never agreed on the “official” nREPL spec, but there’s some finally some movement on that front - see https://github.com/nrepl/spec.nrepl.org/pull/1

bozhidar 2026-02-18T15:09:57.418509Z

But as jank is so similar to Clojure, I think for you it should be easier than average to fill in the gap in the meantime - you can just adapt the test suite of the Clojure nREPL implementation or something along those lines. Or perhaps directly test against a client like Calva or CIDER.

borkdude 2026-02-18T15:13:34.805839Z

or just port babashka's nrepl server or look at its tests :)

bozhidar 2026-02-18T15:18:10.459269Z

Well, that’s also an option. Once we settle on the final nREPL spec I plan to write a simpler reference server for it as well, as it seems it’d be hard to get consensus on whether things like sessions are essential or only nice to have.

👍 1
borkdude 2026-02-18T15:18:53.368999Z

maybe a test client could also work that you can fire at every posssible dialect that has an nREPL server

bozhidar 2026-02-18T15:20:13.244249Z

Yeah, we’ll certainly need a spec-compliant reference client as well. But this is the easy part - agreeing on the spec will be a bit harder. 😄

jeaye 2026-02-18T17:59:22.983499Z

Thanks for the follow up! I've been watching the spec develop with interest. 🙂

jeaye 2026-02-18T18:01:45.044459Z

> or just port babashka's nrepl server or look at its tests 🙂 Following bb's tests to build my own jank suite can work, but it would not be my first course of action. Just as the community needs a clojure-test-suite, it also needs a MVP nREPL server test suite. I think a spec is a great way to make this even more viable.

👍 2
bozhidar 2026-02-18T18:04:13.677329Z

Well, I can only hope more people will participate in the discussion and driving it forward. If @technomancy doesn't have time to wrap up the PR himself I'll just merge it at some point and we'll continue to iterate on it.