Unravel does it but I think it's still considered an experimental feature.
(And I think it needs the compliment JAR locally for that)
Thanks a lot. Last question, how I can add compliment as dependency to dev process in chlorine?
It's just a library. You add it to your project the same way you add any other dependency.
If you're using a variant of my dot-clojure deps.edn
file https://github.com/seancorfield/dot-clojure/blob/master/deps.edn#L71-L72 it has an alias for compliment @ahmed1hsn
Does compliment works for clojurescript or only clojure?
No idea. I don't do anything with cljs.
re: cljs support in compliment -- perhaps this is relevant: https://github.com/alexander-yakushev/compliment/issues/42
What is difference between inspect-block
/`inspect-top-block` and evaluate-block
/`evaluate-top-block`?
@ahmed1hsn the inspect functions submit the code / value to REBL, the evaluate functions do not.
iiuc, one is for using rebl, while the other doesn't use rebl
the following can show the details: https://github.com/mauricioszabo/atom-chlorine/blob/master/src/chlorine/repl.cljs
Thanks, I'll have a look.
Compliment does not currently supports ClojureScript
On Chlorine, there's some kind of autocomplete for ClojureScript, where we inspect the goog.global
variables and demunge then to ClojureScript equivalent
It works, but sometimes it can't autocomplete some core functions, and also there's no support for macros.
It's on the list to add full autocomplete with clojurescript (there are already some libraries that inspect the itnernal state of cljs compiler to provide it - I just couldn't make it work with Shadow some months ago)
Hey all, please forgive or ignore a newbie. I find the main chlorine page to be written in a way that requires more understanding than I have. Is there an even simpler guide somewhere? (Fwiw running Emacs with Cider I found trivial...)
I wasn’t very clear above - I mean getting going with a repl. The “usage”, section, basically. How to start and connect to a repl. ☺️
@mattias504 A couple of Qs so I can try to guide you: what tooling are you using? Lein/Boot/clj Do you know how to start a Socket REPL in a process?
@mattias504 also, when you're able to connect, please tell me what you found confusing so I can update the Readme (or open a pull request too :))
Oh, hey, thanks! I’ll be happy to help in any way. So, I have Atom installed with Ink and Chlorine. So far only used Lein, but wouldn’t mind other tools if it’s easier. Want to learn them at some point anyway.
Ok, for Chlorine to work you need to start a repl with lein. On the Readme is the exact command that you should run:
JVM_OPTS='-Dclojure.server.myrepl={:port,5555,:accept,clojure.core.server/repl
Are you on Linux, Mac, or Windows?
As for socket Repl process, I don’t think so. I haven’t studied how Cider manages, so I’m assuming it handles some magic behind the scenes. On a Mac.
Sorry about being slow, time to put my kids to bed here... 😅
I think cider starts a repl in background. Chlorine expects you to be running you repl on a terminal
Well, now I know it’s not complicated, at least! Thanks. Getting a “REPLs disconnected” message when I try to connect. Are there JVM dependencies? Right now trying out the OpenJ9 variant of JDK 12...
No, there are no other dependencies. I'm also using the OpenJ9 variant, so it shouldn't be a problem. Os the port correct? Can you check if port 5555 is really open, maybe with telnet or nmap?
Well, Lein outputs the port as 56106, but neither work. That is strange, though, as I used your exact line for the JVM-OPTS.
Try to connect on 5555
Lein is reporting the nrepl port, Chlorine works with a socket repl
Or try to run: JVM_OPTS='-Dclojure.server.myrepl={:port,4444,:accept,clojure.core.server/repl}' lein repl And connect to port 4444
lein
starts nREPL (on the 50K+ port. You need to start a Socket REPL for Chlorine.
I think I'll add this information on the Readme. People seem confused with this sometimes...
😄
In my ~/.lein/profiles.clj
file, I have
:socket {:jvm-opts ["-Dclojure.server.lein={:port 55555 :accept clojure.core.server/repl}"]}
and then I use lein with-profile +socket repl
to start a Socket REPL on port 55555.The JVM options (as shown by Mauricio above) works on Mac/Linux -- but not on Windows.
(but I use clj
instead of lein
for almost all projects these days)
Thanks for the patience and the help. A few minutes before I get to my computer, but I’ll manage. But I agree, for the onboarding a short primer on the different REPL-related terms might be handy.
Clj as in just using Clojure?
@mauricio.szabo Are you using clj
or lein
or something else?
clj
as in the CLI / deps.edn
tooling that Cognitect released.
Cool. I mix them up, but a recent podcast went through the different tools. Was a nice overview and made me decide to look into them soon.
At work, we started on Leiningen back in 2011 because that's all there was. We switched completely to Boot in 2015, then switched completely to clj
/ deps.edn
a while back (maybe last year? I'd have to consult our git history...).
@seancorfield hmm, that lein/profiles.clj, is that for Lein or deps.edn or both?
~/.lein/profiles.clj
is for Leiningen.
Makes sense 😋
For my clj
projects, I use https://github.com/seancorfield/dot-clojure as my ~/.clojure/deps.edn
file.
Oh, btw, weren’t you interviewed in a podcast recently? Hope I’m getting it right, that was all very informative a fun listen!
Thanks, I’ll do some experimenting in a while.
Yeah, I was on defn
...
I'm going to be on Jacek Schae's podcast at some point ("Season 2" is being recorded, and it's all about tooling).
I'll also need to carve out more time to do some more screencasts of clj
/ deps.edn
and Atom/Chlorine and REBL...
😅
https://www.youtube.com/channel/UC8GD-smsEvNyRd3EZ8oeSrA?view_as=subscriber (three "episodes" so far)
I'm planning to do one using tools.deps
add-lib
branch so I can show how to interactively build a small web app starting from an empty deps.edn
file and dynamically adding all the libraries I need via the REPL...
Oh, very cool. I could have watched the Chlorine one and not bothered everyone. Thanks for the link!
And that last bit sounds suspiciously like what I’m doing while learning Clojure. I’ll be there on release day 🙂
I think add-lib
is one of those real gems for interactive development but because it's on a branch, rather than master, it's not getting anywhere near as much exposure as it deserves.
Combined with tools.gitlibs
, you can even use it to dynamically add the "master" version of any GitHub repo as a dependency in your project!
Wow. Have to admit, after a life in the regular compile/run/try-to-test world, just a few fumbling tries with Clj in a repl feels freer and more expressive and just a lot more fun. Crazy.
I like to think of it like this: Leiningen is "easy", clj
is "simple". 🙂
For closure - between my phone and computer and copying strings and typing, I had managed to mess up both a ‘ and a }. Life as a programmer... all is well, see you all later in Atom REPL land 😁
@seancorfield I use lein
most of the time, shadow-cljs when I need ClojureScript but not clojure
Also, I'll appear too on Jacek's podcast, probably by the end of september.