Closed jonase closed 10 years ago
I think going "nrepl" is a good next step.
Should session be a middleware, a transport, both, or neither? Trying to get up to speed on the design of nrepl.
In any case, it would be great to support both a) evaluation from the session web UI b) evaluation from other nrepl clients (and log the back-and-forth traffic in datomic)
The main design question is, how should this traffic be represented in datomic? The main options seem to be a) treat the messages as a string b) have a more granular schema to capture the map components as attributes
In the longer term we'll also want to hook into the likes of ritz.
There are some interesting design notes at https://github.com/clojure/tools.nrepl/wiki/nREPL.Next that I will try to internalize.
Is there a list of repl endpoint implementations somewhere?
The base case example shows starting up the server on a port, and connecting the client to it.
I'm looking for a way to do it without ports for our base case (when the session server and the nrepl endpoint are in the same jvm) . Seems there should be a way but requires understanding the code.
If we make an nrepl schema, we'd want it to somehow mirror whats here: https://github.com/clojure/tools.nrepl/blob/master/doc/ops.md
First cut at nrepl backend here: https://github.com/jonase/session/compare/master...nrepl
Note that there are more changes than are necessary for the nrepl backend as i did the work in a branch where I had previously made the datomic connection and aleph channel explicit (inside a ctx map) instead of as global vars.
The interesting part for the nrepl backend is probably the new session.nrepl namespace and corresponding schema changes.
Thats great news! Is there any reason not to merge this in?
In the latest version of session, we are going with a different architecture that is not particularly compatible with nrepl...
I think it would make sense to use nrepl as the evaluation service. It would open the door for simple solutions to at least the following issues:
22 - run
lein repl :headless
in the context of any leiningen based project and connect to it from session. Classpath issues are taken care of by leiningens repl.18 - cljs evaluation could be implemented as nrepl middleware
15 - I believe nrepl is capable of this
14 - nrepl has
interruptible-eval
[1].11 - nrepl provides this
Some work has already been done in an old patch by @hiredman (#3). I could try to move this forward if you (@kovasb) still think it’s a good idea.
[1] https://github.com/clojure/tools.nrepl/blob/master/src/main/clojure/clojure/tools/nrepl/middleware/interruptible_eval.clj