Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clojure socket server support #638

Open
SuperCuber opened this issue Jan 1, 2025 · 1 comment
Open

Clojure socket server support #638

SuperCuber opened this issue Jan 1, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@SuperCuber
Copy link

Is it possible to support a Clojure Socket Server ?

I have code running on a remote k8s pod and I think the easiest way for me to attach a REPL session to that pod is to give it an environment variable and connect to the socket. I have no trouble connecting (and I can port-forward it to make the port appear locally) and even running ConjureConnect localhost:5555 works! But then sending a form hangs and no command really work properly :(

I assume lots of functionality is impossible to implement (like interruption) but it would be amazing to have rudimentary support for sending a form + current namespace information to the remote process.

@Olical Olical added the enhancement New feature or request label Jan 15, 2025
@Olical
Copy link
Owner

Olical commented Jan 15, 2025

Personally, I'd recommend you add nREPL as a runtime dependency and start one of those, I've used that before to debug some prod things and it worked great. Although it does bring in a bunch of dependencies which might not be acceptable in some situations.

Socket REPLs are a neat idea because they're so simple, but that makes them pretty impractical as a dev tool. I found that they're better as a program to program communication channel that's built into the language instead of a developer tool.

They're also good as something you can netcat into to get a very bare bones REPL on a remote host in your terminal.

I actually wrote at length a few times about why nREPL is so much better for development than socket REPL or prepl but I can't find my comments / posts on the matter right now. Conjure originally worked with prepl (socket REPL + data wrappers for each message) in a previous iteration but I gave up on it, it was too limited. I even got some changes merged into Clojure to fix some issues with the prepl implementation!

So, if you absolutely need a socket REPL support, we can look at building a Clojure client that talks socket REPL, not nREPL (they're completely distinct and not interchangeable as is) but I'd advise against it. It'll be a whole new client that will be far less capable than the existing one.

I hope this helps somewhat!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants