This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-17
Channels
- # announcements (2)
- # aws (44)
- # beginners (96)
- # calva (10)
- # cider (7)
- # cljdoc (5)
- # cljsrn (2)
- # clojure (38)
- # clojure-dev (19)
- # clojure-europe (6)
- # clojure-italy (16)
- # clojure-nl (10)
- # clojure-norway (44)
- # clojure-spec (7)
- # clojure-uk (74)
- # clojurescript (133)
- # cloverage (1)
- # cursive (54)
- # datomic (78)
- # duct (11)
- # graalvm (5)
- # instaparse (4)
- # joker (3)
- # kaocha (5)
- # nrepl (2)
- # off-topic (10)
- # pathom (56)
- # pedestal (1)
- # reagent (7)
- # reitit (17)
- # shadow-cljs (144)
- # slack-help (2)
- # sql (35)
- # testing (5)
- # tools-deps (22)
- # vim (22)
- # xtdb (11)
REBL advice needed (is the a better channel?) : I run a remote nrepl server and connect to it with a local nrepl client (mostly via Cursive). I want to include REBL but run it on the local machine, not the server. Is it possible? (I know there is a nrepl middleware for REBL but I guess it assumes REBL is running on the same jvm as the repl itself). Thank you!
It’s not possible. REBL has to exist in the same JVM as the forms it’s browsing. I spoke to Rich about this a while back, and IIRC it’s because to do it you need to implement weak-references over the wire; to enable GC etc. (He implemented such a system years ago in common lisp http://foil.sourceforge.net/ and I guess wanted to avoid the complexity for only marginal use-cases)
my nrebl middleware works reasonably well though but it does assume you’re in the same vm: https://github.com/RickMoynihan/nrebl.middleware
I see, thank you! 😢
I played with rebl, can't tell anything about nrepl, but rebl uses prepl, and you can pass your own prepl function to it
cognitect.rebl/ui
accepts :proc
keyword argument, which should be a function of 2 args: in-reader
and out-fn
, as clojure.core.server/prepl
I played with it, here is what worked for me:
(cognitect.rebl/ui :proc
#(clojure.core.server/remote-prepl
"localhost" 50505
%1 %2
:valf (partial clojure.edn/read-string {:default tagged-literal})))
I’m pretty sure this approach won’t work properly, especially wrt the datafy/nav behaviours. https://clojurians.slack.com/archives/C6QH853H8/p1571386900140400?thread_ts=1571321859.133900&cid=C6QH853H8
though it may well be good enough for basic use
but you’ll not get the metadata/protocol dispatch that REBL supports. REBL will only be able to walk the literal syntactic forms.
yes, datafy/nav will be much more limited since it happens in the same vm and not over wire, but rebl will still work.
Also it won’t be able to follow the repl etc
forms evaled into nrepl won’t appear in REBL
so only forms entered through REBL itself
unless i’m misunderstanding something
I don’t think it’s anything to do with the difference between socket-repl and nrepl. I think it’s more to do with that they’re in different processes and can’t share the stdin stream to intercept.