Fork me on GitHub
#nrepl
<
2019-06-04
>
bozhidar07:06:27

> I have a strange situation with my work project (Leiningen + lein-figwheel), with four different behaviours on four different machines. Let’s call them A, B, C and D .

bozhidar07:06:17

@pez Did you manage to sort this out? The problems you described didn’t seem nREPL related to me, more like something to do with Lein.

bozhidar07:06:35

> Hello, I am going to appear on a Clojure podcast soon, to talk about Calva. In pondering what the heck to say, I started to think about how nice it would be to be able to use Calva together with Lumo. From what I understand, a big hurdle there is the lack of an nrepl server. But I have also heard rumours about an nrepl server being possible on top of the socket server. Is that so? What can you share about the prospects of using an nrepl client with self hosted ClojureScript?

bozhidar07:06:45

Adding to what was already said here - I think that implementing an nREPL server in ClojureScript won’t be hard, provided someone decides to tackle it. But the real difficulty would be the broader ecosystem of middleware - most of them rely on Java in one way or another and porting a lot of middleware is obviously a lot of work.

bozhidar07:06:42

That’s why we avoided in general the route of the self-hosted nREPL for ClojureScript and tried to do as much as possible with the boostrapped version - this simplified a lot the work needed to provide “some” ClojureScript support.

bozhidar07:06:23

In the end of the day it’s always fairly simply to provide some basic eval functionality, but the more complex the features get, the harder it is to avoid using some host features.

bozhidar07:06:46

> However, I also do not know what unrepl support for self hosted cljs would mean for Calva.

pez07:06:48

Re: my timeout problems. I thought it might be nrepl related a while because had different results with some different dependencies injected, but that was a smoke screen it seems. It is probably something to do with some libraries we use. We'll figure it out, hopefully.

bozhidar07:06:18

I assume it would mean nothing, as you’d have to implement a different API if you want to support unrepl/prepl.

👍 4
dominicm07:06:47

To clarify my intention here, unrepl's problem with running over a socket repl are the same problems that nrepl will have, same approach.

bozhidar07:06:31

Yep, exactly.

bozhidar07:06:24

I spent some time researching the possibility for supporting different REPL providers in CIDER in the past, but in the end it seemed like too much work for very little gain.

pez07:06:55

Calva is pretty bare bones. So probably not a lot of middleware involved.

bozhidar07:06:56

You basically need to provide an abstraction layer over nrepl/unrepl/prepl and have to reconcile the differences between them in that layer.

bozhidar07:06:02

If you’re mostly using eval I guess you can get away with an nREPL implementation that simply doesn’t support middleware at all and just provides the ops you need for Calva.

bozhidar07:06:54

I know that’s what Arcadia’s team did to build a working nREPL server for ClojureCLR. Their implementation was something like one file and would be a good starting point for ClojureScript support as well.

pez07:06:50

Cool. I'll have a look at that. Arcadia is another environment I'd like Calva to be useful with anyway.

bozhidar07:06:15

For Arcadia it’s simpler in general - I think the piggieback approach (just provide eval support via middleware) would work for them.

bozhidar07:06:12

> This is an nREPL bridge for Arcadia Unity. It spins up a standard nREPL server and it redirects eval operations to the Arcadia UDP REPL. This will allow to use existing tooling and editor integrations without the need to port nREPL and other middlewares/libraries to ClojureCLR.

bozhidar07:06:29

That’s the beauty of nREPL modular architecture in action. 🙂

pez07:06:52

You are making me cry here. 😃

dominicm07:06:47

To clarify my intention here, unrepl's problem with running over a socket repl are the same problems that nrepl will have, same approach.

bozhidar07:06:53

@pez I didn’t want to ruin your day. 😉

pez07:06:36

Haha, I just have a soft spot for beauty.

bozhidar08:06:21

😄 😄 😄