nrepl

bozhidar 2022-03-14T11:25:10.253469Z

@daslu If there's was a clear problem we are aiming to solve I guess we can do something about it.

bozhidar 2022-03-14T11:25:25.197299Z

> Some tools like to use nREPL middleware to listen to the user's code evaluations. Can you expand on what do you mean by this?

Daniel Slutsky 2022-03-14T11:35:03.667279Z

@bozhidar thanks, I guess what wrote was indeed a bit vague. 🙏 Here is what I have been practicing recently (in both CIDER and Calva): listening to user code evaluations through nREPL middleware, and sending the relevant values to Portal. Demo: https://www.youtube.com/watch?v=e3M4u1XIVTo&t=940s The related example project: https://github.com/scicloj/visual-tools-experiments/tree/main/portal-clerk-kindly-nrepl-1 Currently, some setup is needed (e.g., in the deps.edn file and the Emacs config). I am wondering about recommended practices for making it transparent to users. 🙏

flowthing 2022-03-14T12:33:43.208009Z

Curious why not tap>?

Daniel Slutsky 2022-03-14T13:32:55.318659Z

@flowthing We are hoping it would be possible to pick an existing piece of documentation -- e.g. this color tutorial: https://clojure2d.github.io/clojure2d/docs/notebooks/index.html#/notebooks/color.clj -- and then evaluate forms in the REPL and see the results in Portal, without any code change. I think (and maybe I'm wrong) that needing to wrap with tap> could be a bit of a nuisance for a user wishing to explore existing code examples. That is one of our short-term hopes at the #visual-tools group. (On the longer term, we are hoping we could listen to all user interactions in the editor & REPL and automatically maintain a live-reloading document that makes sense out of them. Notespace v4 is one attempt of this kind (see the demo https://www.youtube.com/watch?v=uICA2SDa-ws), but it is not complete yet, and not our current focus.)

bozhidar 2022-03-14T13:50:23.654469Z

Might be best file a ticket or some discussion on the subject and we can discuss this topic more there.

Daniel Slutsky 2022-03-14T14:01:30.299009Z

That is great, thanks @bozhidar -- an Issue at the nREPL repo, right? https://github.com/nrepl/nrepl

flowthing 2022-03-14T14:37:47.186529Z

> and then evaluate forms in the REPL and see the results in Portal, without any code change. I see, that makes sense. > I think (and maybe I'm wrong) that needing to wrap with tap> could be a bit of a nuisance for a user wishing to explore existing code examples. I have a key binding that lets me evaluate (tap> $0), where $0 gets replaced with the form that's currently under my caret. I know it's not exactly the same thing, but just a thought.

🙏 1
Daniel Slutsky 2022-03-14T14:42:10.442549Z

Nice!! Thanks, yes, eventually we might need some specific integration into specific environments (e.g., CIDER, Calva). I am just still hoping we would not need that, and find something that just works for any user. 😊

flowthing 2022-03-14T14:43:50.066529Z

Certainly, that makes sense. An nREPL-based solution won't work for every user, although it certainly will for the vast majority.

👍 1
Daniel Slutsky 2022-03-14T15:51:52.849639Z

Created an issue here: https://github.com/nrepl/nrepl/issues/269 Thanks, @bozhidar & @flowthing.