Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top