Fork me on GitHub
#chlorine-clover
<
2021-03-16
>
mauricio.szabo00:03:02

Yes, that's the use-case for embedded repl. On ClojureScript with figwheel-main or shadow, the ClojureScript "REPL" lives on the Clojure side. The reason is that JS can't really open a socket server (and the compiler is in Clojure so even if it did live on JS side it would not be able to compile cljs forms into JS code)

mauricio.szabo00:03:31

So, an "embedded REPL" is a Clojure REPL that is able to run ClojureScript code. How it works differs from implementations, but most of the time is a command that you run on the Clojure side and then the REPL starts to understand ClojureScript

mauricio.szabo00:03:54

(it's a little bit more complicated because you have things like macros that, to be able to get the documentation for it, need to run on Clojure side, but that's about the ideia)

seancorfield00:03:39

Thanks for the explanation. Every time I think I’m beginning to understand how ClojureScript tooling works, I discover something new that undermines my previous (mis-)understanding 🙂

mauricio.szabo00:03:12

Yes, ClojureScript tooling is quite a pain 😅

mauricio.szabo00:03:28

The whole problem lives in this "Cljs compiler lives in Clojure world" thing...

seancorfield01:03:30

@mauricio.szabo Would it be possible for Clover to show results inline in the editor? I’ve seen quite a few extensions that seem to popup annotations in and around the code as you type so it sounds feasible… even if it is just to display the first 70 or 80 characters from a printed result.

mauricio.szabo12:03:01

@seancorfield It is possible, but the current code makes things a little bit difficult. Because of the UNREPL dependency, there are moments when the result is not "printable". I'm working on lots of simplifications and also change a lot of the current "render code" (again, in the current code both are quite tied so it's hard to separate them) so it's easy to get a "textual representation" and a "HTML representation" of an eval result.

mauricio.szabo12:03:27

Also, again, vscode API is quite hard to work with, and Clover is a "simple port" so to be honest, I didn't study too much vscode to make the port 😄. I even have to change some code because it seems I used some APIs that are harder to work with.... so now that I'm starting to have free time again, I'll re-organize my ideas and try to make a better vscode version, maybe even test with the current Calva version and delete my older code that simulates what calva already do (so the plug-ins play nicer and one do not try to get into the other's way)

pez18:03:45

I totally failed at extracting things out of Calva. But it wasn’t so much for lack of trying, just have so limited amounts of time in this life. 😃 Let me know if there is anything Calva can do to move out of the way of Clover. Not sure I can do so much more than what’s already been done, but anyway, as long as I am unawaere of things, I can’t do much. Haha.

mauricio.szabo15:03:03

@adamrenklint were you able to make the REPL connect?

adamrenklint15:03:52

@mauricio.szabo No, unfortunately no luck. I tried with the experimental flag on and off, also tried to simplify the shadow-cljs config to a single bundle. > (if you toggle “Enable experimental features” on Chlorine, you’ll see the error happening) Where should I see this error?

mauricio.szabo15:03:24

When you connect embedded and try to evaluate a CLJS command

mauricio.szabo18:03:11

(only with experimental features on)