Embedding dynamic languages inside OSGi/Nakamura
Java Python Ruby
Latest commit bf5308a Jun 5, 2012 @marktriggs Clojure fix


Using it:

  * Run Nakamura with the extra JVM switch:


  * Then:

     $ cd nakamura/bundles
     $ git clone [swissarmybundle.git url]
     $ cd swissarmybundle
     $ mvn -P redeploy clean install
  * Wait hours for Maven.  The bundle should eventually load

From here, there are a couple of ways of getting a REPL.  The

   $ curl http://localhost:8080/system/swissarmy/python


   $ curl http://localhost:8080/system/swissarmy/ruby


   $ curl http://localhost:8080/system/swissarmy/clojure

will open a socket listening on a port (shown in the Nakamura
console).  From here, you can just:

  # For Python or Ruby
  $ telnet localhost 4010


  # For Clojure
  M-x slime-connect RET localhost RET 4010

You can also provide a selector to get a REPL running in the context
of a request for a particular resource:

  $ curl -s http://localhost:8080/~mark/public/authprofile.python.json

  $ curl -s http://localhost:8080/~mark/public/authprofile.ruby.json

  $ curl -s http://localhost:8080/~mark/public/authprofile.clojure.json

and then connect using the commands above.

Here's a quick screenshot of running a Python repl:


WARNING: This opens a security hole the size of... a large security
hole, so be careful where you run this.