chlorine-clover

About Chlorine for Atom and Clover for VS Code: https://atom.io/packages/chlorine and https://marketplace.visualstudio.com/items?itemName=mauricioszabo.clover
mauricio.szabo 2021-03-16T00:13:02.036600Z

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.szabo 2021-03-16T00:14:31.039400Z

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.szabo 2021-03-16T00:15:54.040800Z

(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)

seancorfield 2021-03-16T00:20:39.041700Z

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.szabo 2021-03-16T00:24:12.042200Z

Yes, ClojureScript tooling is quite a pain 😅

mauricio.szabo 2021-03-16T00:25:28.044400Z

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

seancorfield 2021-03-16T01:47:30.001500Z

@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.szabo 2021-03-16T12:06:01.004Z

@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.szabo 2021-03-16T12:08:27.006600Z

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)

mauricio.szabo 2021-03-16T15:32:03.006900Z

@adamrenklint were you able to make the REPL connect?

adamrenklint 2021-03-16T15:41:52.008Z

@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.szabo 2021-03-16T15:42:24.008300Z

When you connect embedded and try to evaluate a CLJS command

pez 2021-03-16T18:07:45.008400Z

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.szabo 2021-03-16T18:55:11.008800Z

(only with experimental features on)