Fork me on GitHub
#unrepl
<
2017-03-12
>
cgrand11:03:48

The dumbest (line-based, char-based would need some escaping) multiplexing layer I can think of is: every line (in & out) starts by a number followed by space and the actual line. 0 is reserved for creation/destruction of in & out pairs.

dominicm11:03:53

I'm a bit confused following this, what is multiplexing?

cgrand11:03:26

@dominicm https://en.wikipedia.org/wiki/Multiplexing?wprov=sfsi1 here channeling concurrent repl sessions over a single connection.

dominicm11:03:25

@cgrand Ah, tangential to what I was asking about previously. By "repl session" do you mean the multiple isolated calls to unrepl/launch (or what it actually is)? Or something else?

cgrand12:03:34

Multiple isolated repls (plain repl, unrepl, whatever)

dominicm12:03:04

And the use case is parallelism?

cgrand12:03:37

No. It's reusing an established connection rather than creating a new one.

cgrand12:03:50

It only matters in contexts where new connections can't be established.

dominicm14:03:50

Why would you need to establish another repl?

cgrand15:03:51

One for the user interactions in the repl UI. One for other tools (eg completion etc)

dominicm15:03:48

Why can't it all be done via a single repl & group ids? Possibly with a few new commands for background evaluations?

cgrand16:03:17

It could but then it would barely qualifies as a REPL. A REPL is a single thread model by definition. I think commands should not execute in the background.

dominicm17:03:17

Okay. Is there a specific reason to adhere to that? Or mostly simplicity reasons

cgrand17:03:18

Simplicity (of model). One connection = serial execution. Want concurrency? Then use several connections.

cgrand17:03:44

The fun thing is that since embarking on this project a fortnight ago my understanding of what is a REPL has been refined a lot. Some points made by Rich when he added the socket repl only made sense recently to me.

thheller18:03:44

@cgrand care to elaborate?

cgrand19:03:43

The serial execution model for once. (See above). The session multiplexing being orthogonal to the repl and marginally needed too.

cgrand19:03:22

The "fun" is that it's usually a feeling I get when teaching.

dominicm20:03:26

This design is really good. It fits really well with Vim's crappy async model. The more I think about it, the more I like it & can see it bringing a lot of useful features to Vim that aren't possible currently.