Fork me on GitHub
#leiningen
<
2018-04-30
>
reefersleep06:04:46

Ah, I guess that makes some kind of sense 😊

reefersleep06:04:20

Not used to think about those distinctions

pre21:04:24

Experienced leiningen user here; I'm unable to start a socket repl after adding :jvm-opts ["-Dclojure.server.repl={:port 5555 :accept clojure.core.server/repl}"] in profiles.clj. Starting lein repl on a lein project's root still starts the nrepl server. What am I missing? V = 2.8.1

alexmiller21:04:05

if you’re putting it in profiles.clj, are you activating the profile?

alexmiller21:04:55

lein with-profile foo repl ?

pre21:04:37

I put it in the global ~/.lein/profiles.clj

alexmiller21:04:48

when you put it in there you put it under a profile name though

alexmiller21:04:07

{:foo {:jvm-opts ["..."]}}

alexmiller21:04:14

then lein with-profile foo repl

alexmiller21:04:33

lein help profiles is useful reading

pre22:04:20

would the default :user profile work?

pre22:04:56

I tried starting lein repl with the above socket conf both in :user and a new :foo keys, yet lein always starts the default nrepl.

pre22:04:08

None of the docs in inf-clojure or leiningen point to it and clojure.docs are often missing key integrations with current tooling. Cider can't support socket repl yet (with no plans in the future).

hiredman22:04:22

lein repl means " lein, start a nrepl server"

hiredman22:04:07

the socket repl flags are not going to stop an nrepl server from being started, they will just start a socket repl in addition to the nrepl server

hiredman22:04:17

the socket repl flags are a feature of clojure, not of lein, so they will cause a socket repl to be started when the clojure runtime initializes

pre22:04:53

What is the purpose of socket repl for existing lein/cider/inf-clojure users who are looking to continue using lein for backwards compatibility or dependency resolution? In the past year and half I've not seen a single usecase for it and none of my teammates are using it.

pre22:04:42

My personal usecase is to switch from cider to inf-clojure, and like most things clojure tooling, things are always broken

pre22:04:26

Thanks @hiredman for your notes

hiredman22:04:40

I am not sure it is useful in the context of lein, but it is useful that you can use it to get a clojure repl running in any program that uses clojure

hiredman22:04:56

I might not use it when developing a program, then I build an artifact (maybe an uberjar) and ship it off to some servers to run, and something weird is going on, I can restart the program with the command line flag and get a repl

hiredman22:04:04

of course, you can include the nrepl server yourself and run it as part of your app, but not everyone does that, and it is nice to be to just pop a repl even if you didn't have the foresight to include nrepl in your artifact

pre22:04:25

I used to ship a http repl, based off nrepl, that makes sense for the usecase, but I can't see how a repl on a telnet is useful to debug prod apps.

hiredman22:04:21

it depends on this an that

hiredman22:04:59

what devs have access to, how apps are deployed, all of which is different everywhere

pre22:04:35

But the socket repl can't locate or manage deps ... I still don't find how it's useful for your usecase, as you can't load anything that's in your ns. Maybe I'm missing something. How is socket better/simpler than, say https://github.com/cemerick/drawbridge

hiredman22:04:47

at my last job(which was all backend data processing stuff), dev's had ssh access to production, and we had a shell script for managing and interacting with the server, which at one point it did over a precursor to the built in socket repl

hiredman22:04:12

that is nonsense, you can load and do whatever with code

hiredman22:04:42

my guess is you are launching a socket repl in the lein process, not in the process of your project's vm

hiredman22:04:55

the socket repl is in the same clojure runtime and can do whatever

hiredman22:04:57

the socket repl is really dirt simple, but nrep's model is richer and allows for more interesting usages (in my opinion)

pre22:04:26

Is it possible to move clojure dev from cider/lein to inf-clojure/socket repl without lein?

pre22:04:15

Asking to see if I need to spend any further time investigating lightweight emacs/clojure tooling (have wasted several days already).

pre22:04:57

If socket repl can't provide a proper clojure dev workflow, then I'm likely never going to look at it again.

hiredman22:04:48

what is your goal? there is a lot of interest and new stuff base around tools.deps.alpha, but it is all really new and very diy, you are going to have to sink time in to figuring it out, hitting edge cases, and figuring stuff out

hiredman22:04:33

if you want a working dev environment, and you have one, stop looking

pre22:04:33

Thanks for asking. I've been using lein/cider for 4 years. My motivation to adopt the new socket repl + clojure 1.9's cli with deps.edn and a lighter emacs (inf-clojure). For a pure cljs dev workflow this means I can avoid depending on nrepl/piggieback deps. That said, each time I tried switching for the past 1-2 years something is always broken ir unsupported. Should I even bother with the latest and greatest 1.9 repl support when they don't work?

hiredman23:04:48

like I said, it is very new, so if you aren't willing to invest significant time in it (and are not already very familiar with the different parts) it likely isn't for you

pre23:04:01

Fair enough, perhaps someone should update the website that all clojure tooling and repls are alpha quality and stop recommending them to any professional development.

pre23:04:31

Thanks again for your advise.