This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-13
Channels
- # announcements (12)
- # babashka (42)
- # beginners (45)
- # calva (60)
- # cider (6)
- # circleci (1)
- # clj-kondo (18)
- # clojure (21)
- # clojurescript (36)
- # conjure (13)
- # cursive (2)
- # datahike (5)
- # datomic (4)
- # depstar (17)
- # emacs (4)
- # fulcro (3)
- # honeysql (2)
- # jobs (2)
- # jobs-discuss (9)
- # lsp (98)
- # malli (32)
- # off-topic (36)
- # other-languages (2)
- # overtone (4)
- # re-frame (5)
- # reveal (7)
- # rewrite-clj (47)
- # shadow-cljs (25)
- # spacemacs (4)
- # vim (7)
how do socket repl's and REBL interact? I expected i could clj -M:rebl
and then nc localhost 50505
and see results in the rebl UI from the netcat session. However, only things entered in the original process with clj -M:rebl
appear there
yeah. was expecting to see something about it in the documentation. I know sean uses it with a socket repl so i'm surprised to see it seems to need a bit more configuration
The socket repl is actually a generic framework for launching processes on sockets, which is configurabls
yeah was wondering if there was a premade "accept" function in cognitect.rebl
made for this but not seeing anything
ah, it seems sean hijacks things on
wrap_in_rebl_submit = (code) ->
"(let [value " + code + "] " +
" (try" +
" ((requiring-resolve 'cognitect.rebl/submit) '" + code + " value)" +
" (catch Throwable _))" +
" (try" +
" ((requiring-resolve 'my.repl/reveal) value)" +
" (catch Throwable _))" +
" value)"
yeah i've got it working with nrepl and ricky moynihan's middleware. I am a bit surprised that nrepl seems to have a better story for it than socket repls
i expected to setup socket-repl with rebl and use inf-clojure and have the first class experience.
i guess a sub repl works
(clojure.main/repl
:read
(fn [request-prompt request-exit]
(let [x (clojure.main/repl-read request-prompt request-exit)]
(if (= x :repl/quit)
request-exit
x)))
:eval
(fn [form]
(let [result (eval form)]
(cognitect.rebl/submit form result)
result)))
@dpsutton For REBL, I have https://github.com/seancorfield/socket-rebl -- a variant of that would work for tap>
and hence Reveal.
Note: if you use a client like Chlorine, Clover, or unrepl/unravel with that library it "doesn't work" because those clients all spin up a second socket REPL and use that for the actual evaluation 😐 but it works great for "dumb" clients.
As a side note: it doesn't work for now 😄. I'm studying other ways to interpret results from the REPL, and I'm trying to document my ideas here: https://github.com/mauricioszabo/atom-chlorine/discussions/241
Sure enough, if I can make this work for Chlorine, it'll work for Clover too. I was trying to figure out why someone would want to use the "Inferior REPL mode", but now I have an example 😄
tool question: what do you use to explore the call graph of your functions? clojure-lsp
has a feature that lets you see all the functions that call your function in a tree (they call it incoming
call hierararchy. The other direction, the outgoing
call hierarchy, doesn't seem to be implemented (why?). Do you use another kind of tool to explore your codebase?
@UA7E6DU04 This tools is based on clj-kondo's output: https://github.com/benedekfazekas/morpheus
thanks @U04V15CAJ!
As a side note: it doesn't work for now 😄. I'm studying other ways to interpret results from the REPL, and I'm trying to document my ideas here: https://github.com/mauricioszabo/atom-chlorine/discussions/241