tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
tolitius 2020-07-11T01:05:56.334600Z

what is a tools.depsy way of starting (--interactive) REPL-y connected to nrepl?

:repl {:extra-deps {nrepl {:mvn/version "0.7.0"}
		              reply {:mvn/version "0.4.4"}}
         :main-opts ["-e" "(require,'[reply.main]),(defn,reply,[_,port,_],(reply.main/launch-nrepl,{:attach,(str,\"127.0.0.1:\",port)})),(ns,user)"
      	             "-m" "nrepl.cmdline" "-i" "-f" "user/reply"]}}
this works (ish), but feels complex + does not exit nrepl once REPL-y is done (ctrl c / ctrl d)

euccastro 2020-07-11T10:57:47.335300Z

do you want to start your nREPL server with the same command?

euccastro 2020-07-11T10:57:55.335600Z

I have this:

{:extra-deps {reply {:mvn/version "0.4.4"}}
   :main-opts ["-m" "reply.main" "--attach" "1337"]}

euccastro 2020-07-11T10:58:13.336Z

but that's to attach to an already running nREPL

tolitius 2020-07-11T14:39:26.337100Z

right nrepl + REPL-y connected to it. I do most of the work in a vi + terminal REPL

tolitius 2020-07-11T14:39:55.337500Z

*right => "start your nREPL server with the same command"

tolitius 2020-07-11T14:41:06.338400Z

nrepl.cmdline optionally takes a repl-fn / -f for the interactive repling

seancorfield 2020-07-11T14:56:41.339600Z

I think, for simplicity's sake, I'd be inclined to use two separate aliases: one to start an nREPL server (and leave it running in a window, or run it in the background), and a second alias to start REPL-y connected to that background process.

seancorfield 2020-07-11T14:58:04.340800Z

I can understand wanting a single command, but I'd probably write a small shell script that just ran two clojure commands if it proved too annoying to run those two commands manually.

tolitius 2020-07-11T17:18:08.343200Z

@seancorfield definitely a possibility, but if I work with several (different) apps that's a twofold repl things to run and exit from I am just looking for "lein repl" / "boot repl" repl-y like experience with deps.edn

seancorfield 2020-07-11T17:21:38.344200Z

Hmm, I never type into a REPL so I only care what my editor integration does. Why do you need REPL-y, specifically @tolitius?

tolitius 2020-07-11T17:21:57.344400Z

I always type into repl )

tolitius 2020-07-11T17:22:52.345200Z

it's connected to vi where I "finalize" my thoughts after I am done thinking in repl

tolitius 2020-07-11T17:23:20.345900Z

and vice versa compile/reload from vi back to repl tp keep thinking

seancorfield 2020-07-11T17:23:32.346200Z

I "think" in a "Rich Comment Form" in my editor -- like Stu Halloway talks about in some of his presos

tolitius 2020-07-11T17:30:11.350900Z

yea, a lot of Clojure devs use an integrated playground to "think" that is just connected to nrepl that runs in the background. I like terminals, terminal repl works best for me since I am focused on small fragments of code at a time. with REPL-y this experience is simple, so I am just looking to get there with deps.edn

tolitius 2020-07-11T17:30:55.351800Z

which I did get with an above alias but it rather feels off + does not exit the nrepl on ctrl c/d

seancorfield 2020-07-11T17:31:05.352100Z

I think you're stuck with the complex/almost-works invocation for now. I'll have a think about it on and off and come back if I figure out anything better.

tolitius 2020-07-11T17:31:40.353Z

yea, nothing urgent, I was just wondering whether I am missing something obvious, i.e. a flag, an option, etc..

seancorfield 2020-07-11T17:31:45.353200Z

(I don't use nREPL at all so it'll be a fun experiment/diversion)

tolitius 2020-07-11T17:31:57.353400Z

good luck and thank you )

richiardiandrea 2020-07-11T19:28:22.356300Z

@tolitius Hey 😉 I am using https://github.com/bhauman/rebel-readline For your exact use case and I found some problems with multi-line expressions sometimes, I am pretty happy with it. I have two aliases I can share (the second is for cljs) not in front of the keyboard now though. Will sent them soon.