Skip to content

Instantly share code, notes, and snippets.

@dandorman
Created August 8, 2017 15:33
Show Gist options
  • Save dandorman/ced9f055c183cb9b0bcdc4b030a33521 to your computer and use it in GitHub Desktop.
Save dandorman/ced9f055c183cb9b0bcdc4b030a33521 to your computer and use it in GitHub Desktop.
A Ruby script for connecting to a Clojure socket REPL
#!/usr/bin/env ruby
# Start up a Clojure process with a socket REPL:
# java -Dclojure.server.repl="{:port 5555 :accept clojure.core.server/repl}" -cp clojure.jar clojure.main
require "socket"
s = TCPSocket.new "localhost", 5555
Thread.new do
loop do
print s.recv 100
end
end
loop do
s.puts gets
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment