Any better client then telnet for connecting to a socket repl server?

678 views
Skip to first unread message

Didier

unread,
Mar 2, 2018, 8:49:45 PM3/2/18
to Clojure
I want to connect to a Clojure socket repl server, but telnet is a really terrible repl experience. Anyway I can have a better client to connect to it that would have some better support for history, backspace, maybe even some auto-complete, highlight, etc. Whatever I can get over telnet?

Thanks

Chris Shellenbarger

unread,
Mar 3, 2018, 1:17:16 PM3/3/18
to Clojure
Can you use NREPL?  https://github.com/clojure/tools.nrepl  

This seems to be what most tools that provide a REPL are built on top of (Cursive, CIDER, etc).

Timothy Baldridge

unread,
Mar 3, 2018, 3:12:00 PM3/3/18
to clo...@googlegroups.com
Sadly NREPL isn't a REPL it's a RPC protocol transport for remote controlling a Clojure instance. 

You might look into rebel: although I'm not sure how well that plays with remote terminals.  https://github.com/bhauman/rebel-readline.

Also look into doing some of this with readline. Perhaps you can pipe something together via netcat, GPL readline, and socket servers?

Also Emacs provide a lot of this support via inferior lisp. So, like any lisp you can tell emacs that your inferior lisp command is a telnet command and it all "just works". 

Timothy

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
“One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.”
(Robert Firth)

Sean Corfield

unread,
Mar 3, 2018, 7:21:21 PM3/3/18
to clo...@googlegroups.com

You can use rlwrap with telnet but it’s a bit of a pain to deal with getting back out of the session. I’ve found the following works:

 

                rlwrap -q ^Q telnet 127.0.0.1 5555

 

This sets up control-q as a quote character so when you’re ready to exit the session you can do ^Q ^] q <return>

 

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

 


From: clo...@googlegroups.com <clo...@googlegroups.com> on behalf of Didier <did...@gmail.com>
Sent: Friday, March 2, 2018 5:49:45 PM
To: Clojure
Subject: Any better client then telnet for connecting to a socket repl server?
 
I want to connect to a Clojure socket repl server, but telnet is a really terrible repl experience. Anyway I can have a better client to connect to it that would have some better support for history, backspace, maybe even some auto-complete, highlight, etc. Whatever I can get over telnet?

Thanks

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.

Kimmo Koskinen

unread,
Mar 4, 2018, 4:57:37 AM3/4/18
to Clojure
Hi!

There are quite impressive socket repl clients such as https://github.com/Unrepl/unravel and https://github.com/Unrepl/spiral (for Emacs) both of which use the unrepl protocol https://github.com/unrepl/unrepl.

- Kimmo

Stuart Sierra

unread,
Mar 10, 2018, 3:33:49 PM3/10/18
to Clojure
I sometimes use inf-clojure mode in Emacs, which can connect directly to a socket REPL. I have a helper Elisp function inf-clojure-to-socket.

You might also try readline with Netcat (nc) as an alternative to Telnet.

–S

Didier

unread,
Mar 14, 2018, 11:49:25 PM3/14/18
to Clojure
Okay, for anyone else coming here and looking, you must absolutely try out Unravel https://github.com/Unrepl/unravel

Its a command line tool that you install through npm (implemented in ClojureScript cool!), and then you can just do:

unravel <ip> <port>

From your terminal, and it will connect to any standard Clojure 1.8+ socket repl and give you a Repl with full emacs like readline, multi-line support, auto-complete, and eldoc style instant documentation. No need to add any extra dependencies to your Clojure project or setup anything more then just activate the socket repl.

Frankly its amazing, and I think everyone who needs to connect to a socket repl should give it a go.

P.S.: Also shout out to Spiral https://github.com/Unrepl/spiral, which is an emacs package for connecting to a Clojure 1.8+ socket REPL which gives you almost as many features as Cider does with nRepl.
Reply all
Reply to author
Forward
0 new messages