Skip to content

Making CIDER more language agnostic? (decoupling Clojure assumptions from CIDER's nREPL client) #2848

Description

@Ruin0x11

It feels like there is a gap for "interactive program exploration" that is only serviced very well in the Clojure ecosystem, like there now is for IDE features (Language Server Protocol) and debugging (Debug Adapter Protocol).

nREPL could be described as a language-agnostic spec, but in practice the implementations of nREPL clients almost always assume Clojure is being used. The documentation on the built-in operations and passed data types isn't as detailed as that for LSP, and the Clojure-specific operations are scattered throughout cider's source code without detailed documentation.

I have tried other nREPL clients but find they're missing features I want that cider does have, like module reloading, that I've implemented on the server side. I ended up having to write a totally separate REPL protocol and client code for one of my games to add the missing features. It worked leaps and bounds better than print debugging and I find that I can't go back to programming without it, but when I wanted to add it to a different project and hack in more program-specific features, I wondered why I couldn't just use nREPL as easily as I could as with my editor and an LSP server.

In contrast with LSP, which lets you pair any client with any server with the expectation that things will just work, you have to be careful not to choose an nREPL client/server that is missing features or assumes Clojure is being used.

What I would like is to be able to take cider and use it with an nREPL server in a language besides Clojure and not have to worry about incompatibilities. I understand this issue might be more of a standardization/onboarding issue than a programming one, but work on it could be done one step at a time. For example, some refactoring could be done on cider's nREPL client code to put Clojure-specific parts behind capabilities (as with LSP), such that cider will not blow up so long as the server doesn't specify that certain Clojure-specific features are available. And for earlier nREPL versions, cider could just fall back gracefully to the previous behavior and assume Clojure is being used, if it doesn't support the server capabilities feature.

Also, I have made an attempt in the past at writing a completely new protocol just for connecting to a remote REPL in a standardized, language-agnostic way, as with LSP and DAP, but found that doing so from scratch would take a very long time, and I wondered why not just leveraging nREPL was off-limits.

Would there any interest in making cider more generic across all programming languages?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions