Fork me on GitHub

Ah, I guess that makes some kind of sense 😊


Not used to think about those distinctions


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

Alex Miller (Clojure team)21:04:05

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

Alex Miller (Clojure team)21:04:55

lein with-profile foo repl ?


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

Alex Miller (Clojure team)21:04:48

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

Alex Miller (Clojure team)21:04:07

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

Alex Miller (Clojure team)21:04:14

then lein with-profile foo repl

Alex Miller (Clojure team)21:04:33

lein help profiles is useful reading


would the default :user profile work?


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.


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


lein repl means " lein, start a nrepl server"


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


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


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.


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


Thanks @hiredman for your notes


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


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


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


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.


it depends on this an that


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


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


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


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


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


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


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


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


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


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


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


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


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?


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


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.


Thanks again for your advise.