1

How can I set it up, so that I can use Light Table on the Mac, connected to a Ubuntu-hosted nREPL, and create a new program/project.clj? Can anybody help me to understand what my approach should be, and where I'm going wrong?

I have a Ubuntu server, in VirtualBox, along with Leiningen, Pedestal, and a pedestal 'helloworld' sample program, that displays in a browser. I just can't connect to the same REPL that runs the helloworld program. I don't have client-side access or control to the server-side object.

I want to do client-server Clojure development from my Mac host LT, creating server-side programs, that I can view in a REPL.

I don't find LT to be intuitive in this area, and the advice I've read only suggests that LT will connect to an existing project/REPL. I want to create new objects, from the client

Alex Miller
  • 69,183
  • 25
  • 122
  • 167
Dvious
  • 23
  • 4

1 Answers1

2

Assuming you are talking mostly about the server side of things (don't know much yet about ClojureScript), here is how you would setup a new project and code interactively against a remote repl.

  1. lein new project-name in your VM.
  2. Setup your project.clj the way you want it. You must include dependencies!
  3. Start the REPL in your VM and note the port number
  4. Commit your code to version control (git).
  5. Checkout the same codebase for editing in LightTable in Mac OSX.
  6. Connect to the remote REPL.
  7. Open core.clj or create a new namespace file and start hacking.
  8. Evaluate your code snippets or the entire file.

There are a couple of potential problems I foresee with this. First is that whenever you add a dependency, you will need to commit the change to version control, synchronize your VM working copy, restart your REPL, and reconnect LightTable to the remote REPL.

Second, you may have problems as the project grows beyond a few namespaces. I believe if your namespace requires another namespace from your project, the remote REPL process will (I think) try to load it off it's local classpath. If the dependency is not there or has changed, I don't think LightTable is smart enough to send the required namespaces over the wire. Try it out and let us know what the actual behavior is.

CraigM
  • 131
  • 7
  • Thanks for answering my next question! The actual solution for me was to use the following to start the nrepl: lein repl :headless :host 0.0.0.0 Then I was able to connect using hostname:nrepl port You've answered the question of how to access files, as LT doesn't have access to my server - github. I understand the problems that you foresee. I'll share my experience, here. – Dvious Mar 04 '14 at 00:56
  • 1
    Have you considered Travis-CI, a continuous-integration tool that works with github. It seems to manage the connections, so that I can impelemnt your solution, without all of the dis/connecting. – Dvious Mar 04 '14 at 22:08