Cursive could do this, yes, since it implements a simple protocol over a socket REPL. However there are complications with that, as you might expect - each eval is then in a different thread and needs dynamic bindings propagated etc. Currently with socket REPLs the evaluations are strictly sequential, but once evals are in separate threads that’s no longer the case, and there is potential weirdness around that too. In general the idea with the socket REPL was to try to keep things simple, and I’m not sure whether that counts 🙂
Yeah, I prefer the mental model for sure. Unfortunately, a great deal of my work involves starting an infinite loop of some sort, and being unable to run them without restarting a repl really stinks.
Cursive’s protocol is similar to pREPL, but it’s structured in both directions, not just on returns.
Yeah, I can see that. I guess one potential middle ground would be to use a single background thread for evals which could be cancelled. That would maintain the sequential nature, but would still require bindings to be maintained etc.
Aren’t bindings mostly out-of-the-box via bound-fn*
?
Or am I missing smth?
otoh, now that you say that, I could just take care to always kick those off in a future
.
somehow never occurred to me :derp:
Right, you could always do it manually yourself, which is a bit fiddly but possible.
But I also really like that middle ground that you mention, if you ever get around to it. No complicated session mgmt business. Just a dedicated solo thread pool.
In the meantime I’ll try out being vigilant with my infinite loops. If I fail catastrophically, I’ll be sure to let you know 😉
Here’s what the prepl server looks like BTW: https://github.com/clojure/clojure/blob/b1b88dd25373a86e41310a525a21b497799dbbf2/src/clj/clojure/core/server.clj#L191. It uses m/with-bindings: https://github.com/clojure/clojure/blob/b1b88dd25373a86e41310a525a21b497799dbbf2/src/clj/clojure/main.clj#L77
But as you can see, there’s really no thread management required at all, which keeps it really nice and simple.
And no fiddly bindings management.
Compare with this at your leisure :): https://github.com/nrepl/nrepl/blob/8223894f6c46a2afd71398517d9b8fe91cdf715d/src/clojure/nrepl/middleware/interruptible_eval.clj#L56
oh I know nrepl
I would never ask you to go there 😄
I was unlucky enough to have a serious run in with piggieback. The beast is real.
Haha, I have to go there pretty regularly. Anyway, the answer is: it’s possible, but I’m not sure it’s desirable. I’d have to try a PoC and see how it ends up.
Well, piggieback is a whole extra level of madness.
Yeah, well. Consider it un-asked until I get back to you. I don’t think it’s crazy to pre-wrap in a future and self-manage.
I was kind of stuck in the mindset of, “Feature exists here. I want it there.”
Hehe, totally fair enough. Let me know if manually wrapping either doesn’t work or is unreasonably painful. You could potentially use REPL commands to make it easier.
Hi, I just allowed IntelliJ to update itself and now I have “Cursive Incompatible (since build 211.0 > IC-202.7660.26)“. I’m not being prompted to update Cursive though. Any help?
That did it, thanks!
you may try uninstalling and then reinstalling Cursive.
I have a repl which has been running for weeks and now if I resize it my machine goes into full takeoff and pinwheels for 5 minutes
yes it does work. If I print a lot of data in the REPL, say around 1 minute's worth of scrolling, then it will slow subsequent window resizing to around 1 second lag on my machine. Clearing the output restores responsiveness
👍:skin-tone-3:
have you tried clearing the repl output?
Is there any way to make Cursive understand shadow-cljs :default syntax? Or at least mute this specific warning?
There isn’t at the moment, sorry, but I’m planning improvements in this area shortly.
I wish I'd remembered before I had to wait
Are there some known issues in the macroexpansion tooling of cursive? Seems like the opened window contains right stuff, but it can't be interacted with, so I can't scroll to view all of it or select any text or change any options in the window
Yeah, sorry, this window basically sucks and I haven’t had time to look at it.
Okey, it seems like a really powerful tool if I could just see all of the macroexpansion 😄
It’s definitely very powerful when it works 🙂
did that fix it btw? was jus a wild guess, I remember clearing the output easing the load on my machine a few times
yes, it's not just your machine