unrepl

discussing specification of an edn-based repl and its implementations.
2018-03-06T12:55:58.000449Z

And solved.... ๐Ÿ˜Ž

cgrand 2018-03-06T15:47:03.000497Z

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

cgrand 2018-03-06T15:47:16.000598Z

@andrea712 ^^

cgrand 2018-03-06T15:47:45.000730Z

We came to the conclusion to use (eval (read-str โ€œuser inputโ€))

cgrand 2018-03-06T15:48:26.000326Z

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

cgrand 2018-03-06T15:49:14.000886Z

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

cgrand 2018-03-06T15:50:09.000870Z

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

Andrea 2018-03-06T15:50:50.000165Z

Arentโ€™ phase prefixes for debugging?

cgrand 2018-03-06T15:51:37.000620Z

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

cgrand 2018-03-06T15:52:16.000354Z

if you get :phase :print you can report that something fishy happeneed and that the dev team has been alerted ๐Ÿ™‚

cgrand 2018-03-06T15:52:41.000713Z

:phase :eval thatโ€™s user fault

Andrea 2018-03-06T15:56:31.000215Z

ah, ok thereโ€™s a phase key in the :exception message

2018-03-06T19:12:43.000053Z

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

2018-03-06T19:13:15.000065Z

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

2018-03-06T19:13:31.000004Z

Output now doesn't interfere with the prompt anymore.

2018-03-06T19:13:55.000530Z

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

dominicm 2018-03-06T19:22:07.000679Z

I need to test this. Will it break fireplace?

2018-03-06T19:28:48.000553Z

dunno

2018-03-06T19:30:03.000114Z

It's very rough.

2018-03-06T19:31:08.000408Z

cmpletion doesn't work, yet

2018-03-06T20:01:14.000015Z

oh, and it's not very well tested.

dominicm 2018-03-06T20:08:32.000115Z

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.

2018-03-06T20:23:20.000211Z

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

2018-03-06T20:23:49.000225Z

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

2018-03-06T20:24:04.000581Z

The lookup things open a window too display the result.

2018-03-06T20:24:12.000294Z

That may mess up your layout.

2018-03-06T20:24:23.000425Z

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

2018-03-06T20:25:16.000641Z

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

2018-03-06T20:25:26.000433Z

I could create a demo.

2018-03-06T20:26:22.000054Z

I was never happy with fireplace.

2018-03-06T20:26:51.000286Z

It had tons of annoying bugs.

dominicm 2018-03-06T20:29:12.000512Z

@kotarak asciinema maybe?

dominicm 2018-03-06T20:30:01.000225Z

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

2018-03-06T20:30:36.000591Z

Ah. Will have a look.

dominicm 2018-03-06T20:31:02.000103Z

I've used ffmpeg to record things before.

dominicm 2018-03-06T20:31:19.000059Z

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

2018-03-06T20:32:48.000268Z

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

2018-03-06T20:33:03.000018Z

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

2018-03-06T20:33:28.000394Z

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

2018-03-06T20:34:07.000127Z

But I'm probably biased.

2018-03-06T20:35:25.000231Z

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

dominicm 2018-03-06T20:41:24.000199Z

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

2018-03-06T21:05:35.000125Z

Here is a short demo: https://kotka.de/vimpire/Small_vimpire_demo.webm

2018-03-06T21:05:42.000625Z

Badly clipped. ๐Ÿ˜•

2018-03-06T21:05:50.000056Z

And typos. ๐Ÿ˜•

2018-03-06T21:06:20.000231Z

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

dominicm 2018-03-06T21:11:35.000344Z

@kotarak you should share it with #vim!

2018-03-06T21:11:53.000526Z

Not yet.

2018-03-06T21:12:06.000078Z

It's not really useable right now.

2018-03-06T21:12:18.000293Z

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

dominicm 2018-03-06T21:12:30.000009Z

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

dominicm 2018-03-06T21:12:52.000028Z

This is really cool!

2018-03-06T21:13:19.000227Z

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

dominicm 2018-03-06T21:13:24.000357Z

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

dominicm 2018-03-06T21:13:41.000020Z

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

2018-03-06T21:13:51.000233Z

No, it's not.

2018-03-06T21:14:11.000096Z

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

2018-03-06T21:14:24.000054Z

This is now fixed. Thanks to channels and unrepl. ๐Ÿ˜„

dominicm 2018-03-06T21:15:51.000236Z

I mean, it's new to me from fireplace

2018-03-06T21:17:55.000345Z

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."

2018-03-06T21:17:58.000287Z

Hehe.

2018-03-06T21:18:37.000596Z

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

2018-03-06T21:19:10.000303Z

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

2018-03-06T21:19:46.000452Z

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

2018-03-06T21:20:09.000152Z

Although, I personally never ever needed something except EvalToplevel.

dominicm 2018-03-06T21:20:43.000565Z

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

2018-03-06T21:21:03.000547Z

Yeah. That almost never works, does it?

dominicm 2018-03-06T21:21:32.000618Z

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.

dominicm 2018-03-06T21:22:06.000127Z

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

2018-03-06T21:22:40.000429Z

Yeah. That's probably the better approach.

2018-03-06T21:23:17.000097Z

The code base is ten years old now. Has some closets to clean out. ๐Ÿ™‚

2018-03-06T21:24:07.000103Z

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

2018-03-06T21:24:18.000117Z

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

2018-03-06T21:31:34.000360Z

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

2018-03-06T21:31:52.000141Z

As I said: things are still shaky.

dominicm 2018-03-06T21:32:10.000641Z

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

2018-03-06T21:36:43.000619Z

Indentation is also wrong in the repl buffer. sigh