babashka

nooga 2026-05-09T22:02:38.063399Z

does bb socket-repl serve nREPL?

nooga 2026-05-09T22:05:25.343539Z

ah, it's nrepl-server

Ingy döt Net 2026-05-09T22:13:04.464429Z

lein repl and gloat --repl and let-go start a nrepl server then connect a client to it. They also can both connect to each other that way. let-go's repl client can't yet connect to a nrepl server. but gloat can connect to the nrepl server that let-go's client starts. I can't see how bb the client can connect to a server.

borkdude 2026-05-09T22:17:20.435299Z

you can connect to an nREPL server by sending bencode to it and implementing the nREPL protocol. a little bit of that is done here for a programmatic invocation: https://github.com/babashka/nrepl-client clojure-mcp-lite also has a bb script that connects to an nREPL server to eval stuff. https://github.com/bhauman/clojure-mcp-light the normal bb repl is just a console REPL, similar to how clj does it. no nREPL needed to self-connect to.

👍 1
nooga 2026-05-09T22:20:25.085449Z

what is socket-repl for?

borkdude 2026-05-09T22:20:37.449509Z

it implements a socket REPL just like clojure has

borkdude 2026-05-09T22:21:34.354599Z

gonna get some sleep now, will reply more later

👋 1
Ingy döt Net 2026-05-09T22:35:55.245969Z

bb (& lein & gloat & let-go) can start a server, and lein & gloat (& calva & etc clients) can connect to that server. It seems like it would be nice if the bb CLI could do the same (be a client).

dpsutton 2026-05-09T23:37:58.310569Z

The socket repl is my preferred connection type. Very straightforward

Ingy döt Net 2026-05-14T22:15:54.717069Z

@dpsutton gloat --srepl creates a socket repl.

Ingy döt Net 2026-05-14T22:19:38.652159Z

Also gloat --repl=+bb (or +clj or +lein or +let-go) starts an nrepl server for that program and connects a Gloat repl CLI client to it (a gloat --repl) This means you can get all the Gloat CLI REPL Features (https://gloathub.org/doc/gloat-repl/#feature-comparison) for bb or the others.