This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-08
Channels
- # aws (3)
- # beginners (126)
- # boot (19)
- # cider (31)
- # cljs-dev (324)
- # clojure (96)
- # clojure-boston (2)
- # clojure-denver (9)
- # clojure-dusseldorf (2)
- # clojure-greece (4)
- # clojure-italy (5)
- # clojure-losangeles (1)
- # clojure-spec (18)
- # clojure-uk (59)
- # clojurebridge (1)
- # clojurescript (184)
- # community-development (29)
- # cursive (2)
- # datascript (2)
- # datomic (5)
- # emacs (1)
- # figwheel (6)
- # fulcro (270)
- # hoplon (2)
- # jobs (1)
- # jobs-discuss (1)
- # keyboards (2)
- # leiningen (2)
- # london-clojurians (2)
- # luminus (10)
- # mount (1)
- # off-topic (26)
- # onyx (8)
- # other-languages (1)
- # parinfer (1)
- # protorepl (6)
- # re-frame (23)
- # reagent (61)
- # reitit (5)
- # shadow-cljs (100)
- # spacemacs (3)
- # sql (19)
- # unrepl (90)
- # vim (25)
It’s good to hear people restating stuff, you get to see things under a different angle
with covering :read
messages it should be more frequent for the client to determine if nothing is “in flight”
At the moment I have to reimplement c.stacktrace. Because it expects a throwable. Also the stacktrace gets elided.
I get an exception via unrepl. I want to pretty print it for human consumption. But I only get an #error with elided parts which doesn't read back in in the tooling connection.
So I need to translate things and have a modified pretty printer to understand the translated thing.
I tried to read a (prn (Exception. ...)) in a plain repl. And it doesn't. Also the elision fails reading.
Otherwise I do think that swapping some parts of unrepl to do most of the pretty printing server-side when the client-side is feeble is a good idea
If you can’t do stuff on the client side, modify the blob to have the server do most of it.
My only grief at the moment is, that the provided representation of the exception cannot be easily machine-read back into clojure. At least not clojure 1.8.
Anyway, in the end it's a none problem. It works already. I just have to duplicate some of the pprint code from eg. c.stacktrace.
Hi, is there some overview comparison between unrepl and nREPL? I haven't been able to figure it out from reading the readme and glancing over unrepl spec.
I like that unrepl wraps socket repl which makes it easy to plug in into CLJS environments. But if someone created a nREPL wrapper over socket repl would unrepl still have some other benefits?
The goal of unrepl is to be transparent to the user: no configuration, no middleware. All you need is a repl (not even a socket one, I routinely test over stdin).
> But if someone created a nREPL wrapper over socket repl would unrepl still have some other benefits?
@kloud Why would do something like this? You’ll still need middleware, so you’d gain very little. What would be more impactful would be to just update the implementation to target Clojure 1.7 and support ClojureScript natively (something that was obviously not possible when nREPL was created).
@U051BLM8F I am working on a clojurescript shell and would like to create a backend so that it could be possible to use it with different readline frontends.
For this one needs more strucuted protocal, so socket repl is not suitable. And there is no clojurescript implementation for nREPL. So I was wondering if unrepl can be utilized since it seems to have cljs support.
What’s wrong with using piggieback? That’s nREPL’s classic way to support ClojureScript. Unless you need support for a self-hosted repl, which is not an option right now.
regular expression of the message stream :unrepl/hello (:prompt :read (:started-eval (:eval | :exception))?)*
I get this: unrepl.repl$pkrTyzbcFcA3scs1I83X8tI0iM0.proxy$clojure.lang.LineNumberingPushbackReader$ILookup$ILocatedReader$ff3fd87c cannot be cast to clojure.lang.IFn
Baron Samedi comes to haunt the voodoo priests who opened a tomb without his permission.
Let's hope your machine doesn't crash and take it into oblivion before you can push. 🙂
you get a prompt after ignored characters (possibly 0 soon, when interrupted from aux) or after evaluation
vimpire does now read tracking. That means commands are framed based on their submission. This is mostly interesting for the tooling repl.
For the repl buffer that means the prompt is only shown once at the end after all submitted commands are executed.
The connection starts out in state prompt. Then input is sent. This happens in a queued context. Agent-like. A context may contain several forms. In particular the context also contains the length of input and callbacks for the events. This is important because vim channels are asynchronous. The conn is put into state evaling. The read event is used to reduce the remaining length. Eval checks whether there is input remaining. If so, the conn is kept in evaling state. The prompt handler sees the evaling state and does nothing. The next form is read. In particular are the proper callbacks still in place. Then we come back to eval eventually. Now assume, the input for the context is exhausted. Then the context is popped from the queue. And the connection is put into awaiting-prompt state. On the next prompt the handler recognises this. It switches the connection back to prompt state and triggers the execution of the next context in the queue (if any). And then things start over.
One special case: if the prompt handler sees the combination of evaling and exhausted input it assumes unrepl/do or whitespace only input and pops the context from the queue itself. The only way the prompt handler can see exhausted input is by skipping the eval handler.
The repl buffer is built on this. With some special handlers for output and exceptions. However, eg. a (read) does not generate read events. So "user=> (read) :foo" will break the connection state because the :foo will be consumed without the conn knowing about it. So it will wait forever for the "remaining" five chars to be read.