This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-01
Channels
- # announcements (2)
- # babashka (26)
- # beginners (26)
- # biff (18)
- # boulder-clojurians (2)
- # cider (16)
- # clj-kondo (34)
- # cljs-dev (4)
- # clojure (22)
- # clojure-denver (10)
- # clojure-europe (16)
- # clojure-nl (1)
- # clojure-norway (10)
- # clojure-uk (2)
- # clojurescript (25)
- # conjure (3)
- # cursive (11)
- # datomic (11)
- # dev-tooling (6)
- # emacs (6)
- # etaoin (7)
- # events (1)
- # fulcro (6)
- # humbleui (11)
- # hyperfiddle (15)
- # instaparse (2)
- # introduce-yourself (2)
- # jobs-discuss (1)
- # lsp (26)
- # malli (7)
- # reitit (5)
- # releases (1)
- # sci (6)
- # shadow-cljs (16)
- # specter (5)
- # vim (5)
Folks, with the recent announcement of Morse, also came the announcement of Replicant. I confess it sounded interesting for me, in theory, but I'm afraid of "jumping in the hype" and commit the same error I made when I decided to use Socket REPL for Chlorine... what do you folks think about this Replicant idea?
It would be nice if there were common infrastructure for paging through structures on the JVM from clients. My understanding is that it’s still relatively young atm. See, for example, this issue: https://github.com/clojure/data.alpha.replicant-server/issues/1
I’ve only taken a cursory look, but it does look very interesting. One thing to note, though, is that since it is hosted over prepl, you’ll have to send unstructured input:
λ clj -Sdeps '{:deps {io.github.clojure/data.alpha.replicant-server {:git/tag "v2023.04.25.01" :git/sha "039bea0"}}}'
Clojure 1.11.1
user=> (require '[clojure.data.alpha.replicant.server.prepl :as replicant])
nil
user=> (replicant/start :host "localhost")
Replicant server listening on 5555 ...
#object[java.net.ServerSocket 0x68f0f72c "ServerSocket[addr=localhost/127.0.0.1,localport=5555]"]
user=>
...
λ nc localhost 5555
(range 512)
{:tag :ret, :val "#r/seq {:head [0 1 2 3 4 5 6 7 8 <SNIP>], :rest #uuid \"f0fc2c09-69b5-4608-b45f-6e3d49ee73d4\"}", :ns "user", :ms 1, :form "(range 512)"}
So if you want to do things like send over the namespace, filename, and line and column info of the thing you’re evaluating, you’ll need to either send that over a separate channel or implement an alternative to clojure.data.alpha.replicant.server.prepl
that accepts structured input yourself. (Which shouldn’t be too difficult, of course.)