sanel / monroe

Clojure nREPL client for Emacs
161 stars 21 forks source link

Make monroe less Clojure oriented? #43

Closed Sasanidas closed 1 year ago

Sasanidas commented 1 year ago

Given that monroe aims to be a general NREPL client, I think it maybe a good idea to generalize the package and remove (or specialize some Clojure specific functionalities)

I was testing a toy nrepl server in python and even tho it's quite clear that the NREPL API(https://nrepl.org/nrepl/ops.html) it's written with Clojure (or lispy dialects) in mind, it can also be use for other language with heavy use of the REPL (thinking mainly of Elixir, Julia and Python).

My main concern is that I'm not sure if this is a goal of the monroe project, so before submiting any pull request, I preferd to ask first. Thanks (and thanks again for this very nice package :+1: )

sanel commented 1 year ago

Hi @Sasanidas,

Thank you for trying it and nice comments! The general idea behind monroe is to be language & platform agnostic, so there is a little Clojure-related code as possible. AFAIK, @technomancy is using it with https://fennel-lang.org and I think someone is using it with CLR (ClojureCLR).

If you have some specific python patches, please send them and let's see how things could be make even more general if necessary. Also, monroe should be 100% backward compatible, so some things might stay a while...

Sasanidas commented 1 year ago

Hello @sanel ,

Thanks for the quick response, I'll be testing monroe with my toy server, I'll submit a pull request (I hope) this week, but some of my ideas are:

Aside from this, maybe add some other calls not strictly from the standard, to improve a better integration with other servers (I don't want to be over the top with this idea, but It's worth a try) Regards :+1:

technomancy commented 1 year ago

Probably the main big offender I can think of here is the jump-to-definition command, which I added a long time ago.

In the long run, the solution to commands like this is to have them implemented as language-agnostic nrepl ops. In fact, this has already happened with completion; it used to be you would have to send a bunch of Clojure code over to the server using eval, but then they added this to the protocol itself: https://nrepl.org/nrepl/1.0/ops.html#completions

If nrepl is serious about being a language-agnostic protocol (and TBH I am not sure whether the people who own nrepl.org treat this as a priority) then it needs to have more of the operations treated this way, so that people don't have to send code across the wire to get basic functionality like finding definitions. But you can't solve this problem just by writing code; you have to convince people to agree on things, which is much harder. =)