Fork me on GitHub
#unrepl
<
2018-03-06
>
kotarak12:03:58

And solved.... 😎

cgrand15:03:03

During the hackday framed-input UIs (eg notebooks) were discussed at length.

cgrand15:03:45

We came to the conclusion to use (eval (read-str “user input”))

cgrand15:03:26

The issue is that by doing so all exceptions become evaluation-time exception

cgrand15:03:14

So this piece of information that unrepl provides (the :phase key) is useless

cgrand15:03:09

This is another point in favor of finding a way to break unrepl in some pieces that can be reused in user code.

Andrea15:03:50

Arent’ phase prefixes for debugging?

cgrand15:03:37

well, if you get :phase :read you can report to the user that his/her input is malformed

cgrand15:03:16

if you get :phase :print you can report that something fishy happeneed and that the dev team has been alerted 🙂

cgrand15:03:41

:phase :eval that’s user fault

Andrea15:03:31

ah, ok there’s a phase key in the :exception message

kotarak19:03:43

@dominicm You asked for code to follow. I also pushed now to the dark side for non-mercurials: https://github.com/kotarak/vimpire

kotarak19:03:15

The repl prints now exceptions in fashion inspired by the yesterday mentioned pyro.

kotarak19:03:31

Output now doesn't interfere with the prompt anymore.

kotarak19:03:55

So (future (Thread/sleep 5000) (println "BTOOM"))) doesn't mess up the prompt.

dominicm19:03:07

I need to test this. Will it break fireplace?

kotarak19:03:03

It's very rough.

kotarak19:03:08

cmpletion doesn't work, yet

kotarak20:03:14

oh, and it's not very well tested.

dominicm20:03:32

No, for sure. I'm just curious of both: 1) What was VimClojure like? (I've only ever used fireplace!) 2) How does this feel in practice. I suspect that it's going to feel really different to what I've become used to.

kotarak20:03:20

I provides some hooks, which you may define as you like. For keyword lookup, code eval, etc.

kotarak20:03:49

And I built-in repl. Which can now read from stdin. Hooray.

kotarak20:03:04

The lookup things open a window too display the result.

kotarak20:03:12

That may mess up your layout.

kotarak20:03:23

I don't care too much, so it's okay for me.

kotarak20:03:16

OT: Do you happen to know, how these gifs are made, which one can often find in the READMEs of a lot of plugins?

kotarak20:03:26

I could create a demo.

kotarak20:03:22

I was never happy with fireplace.

kotarak20:03:51

It had tons of annoying bugs.

dominicm20:03:12

@kotarak asciinema maybe?

dominicm20:03:01

screenkey (linux) is quite popular, or screenflick which it apparently copies. (mac)

kotarak20:03:36

Ah. Will have a look.

dominicm20:03:02

I've used ffmpeg to record things before.

dominicm20:03:19

@kotarak what bugs have you found in fireplace? I've found it very stable overall.

kotarak20:03:48

In the beginning you couldn't eval a function with a comment. Because it put everything on one line.

kotarak20:03:03

Then you lost the line and file info. Because it put everything on one line.

kotarak20:03:28

But hey! It's superior to that other sucky plugin, which even provides a repl.

kotarak20:03:07

But I'm probably biased.

kotarak20:03:25

And that were the early days. Don't know how it is today.

dominicm20:03:24

It doesn't do that anymore 🙂. That's for certain. It has quirks though. But that's "legacy" from nREPL days.

kotarak21:03:42

Badly clipped. 😕

kotarak21:03:50

And typos. 😕

kotarak21:03:20

Anyway. It shows how to run the venom generation. In case you want to play around.

dominicm21:03:35

@kotarak you should share it with #vim!

kotarak21:03:06

It's not really useable right now.

kotarak21:03:18

I'm right in the middle of the transition to unrepl.

dominicm21:03:30

They'll get a kick out of knowing it's in progress.

dominicm21:03:52

This is really cool!

kotarak21:03:19

Well, except for the future and (read) this is VimClojure's funtionality from five years ago....

dominicm21:03:24

My only ask is that you provide an operator for evaluating a text object, because I use vim-sexp and I like doing things like cpaF

dominicm21:03:41

it's cool that this is working. The REPL buffer is new.

kotarak21:03:51

No, it's not.

kotarak21:03:11

The repl buffer was there from the beginning. With the limitation, that you could not read from stdin.

kotarak21:03:24

This is now fixed. Thanks to channels and unrepl. 😄

dominicm21:03:51

I mean, it's new to me from fireplace

kotarak21:03:55

From fireplace's README: "You know that one plugin that provides a REPL in a split window and works absolutely flawlessly, never breaking just because you did something innocuous like backspace through part of the prompt? No? Such a shame, you really would have liked it."

kotarak21:03:37

Regarding your question: So you want an operator which takes some text object/motion(?) for eval?

kotarak21:03:10

It has that for line, paragraph, visual block and toplevel.

kotarak21:03:46

It's probably better to provide a generic eval-this-thingy and ways to provide this.

kotarak21:03:09

Although, I personally never ever needed something except EvalToplevel.

dominicm21:03:43

@kotarak I do weird things like oh, what's the value of XYZ and evaluate the symbol under my cursor.

kotarak21:03:03

Yeah. That almost never works, does it?

dominicm21:03:32

It works in 2 situations, 1: constants referenced, 2: when I have https://github.com/gfredericks/debug-repl on, which lets me "pause" inside a function.

dominicm21:03:06

In some ways, I just like the idea of vimpire separating operation from object though. It's a bit of a purists view though.

kotarak21:03:40

Yeah. That's probably the better approach.

kotarak21:03:17

The code base is ten years old now. Has some closets to clean out. 🙂

kotarak21:03:07

This debug-repl was not possible before. But now, that we can hijack the repl.....

kotarak21:03:18

It could work. I'd have to have a look.

kotarak21:03:34

Hrm. There seem to be some redraws due, although vim states otherwise.

kotarak21:03:52

As I said: things are still shaky.

dominicm21:03:10

There's now also https://github.com/vvvvalvalval/scope-capture which is a bit simpler.

kotarak21:03:43

Indentation is also wrong in the repl buffer. sigh