Fork me on GitHub
#unrepl
<
2018-01-12
>
cgrand14:01:00

I’ve (re)watched Stu H “repl/sidecars” talk and I’m wondering to which extent using main/repl is advisable.

cgrand14:01:04

It’s ok for a quick personal hack but it doesn’t compose well.

volrath14:01:29

@cgrand not sure if on the same topic, but moving to an own unrepl/repl implementation may be beneficial for cljs as well, since there's no main/repl template afaik -- it'd be great if we could duplicate some code there

cgrand14:01:15

@volrath I was thinking about the idea of people shipping specialized repl tools based on repl upgrade (`main/repl` being used most of the time): this approach doesn’t compose.

cgrand14:01:49

As for having a main/repl equivalent to share code with cljs, I’m not sure

cgrand14:01:40

the blocking/async chasm makes it difficult to share code that low

volrath14:01:33

I think some of the async mess could be abstracted away, but it's only a hunch, I do not have a well formed understanding of all the details of cljs repl yet

volrath14:01:58

re. specialized repl tools, could you give an example?

cgrand14:01:19

the trick is that here is not such a thing as “the cljs repl” 🙂

cgrand14:01:05

re “specialized repl tools”, well you can’t have one tool that upgrades to have a pretty printer, one to have nicer exceptions etc.

cgrand14:01:28

all you can do is provide things and let the user build its own repl from this

volrath14:01:00

definitely main/repl could become a roadblock soon when moving in that direction

volrath14:01:16

what I wonder right now is if it's really useful to go that way, instead of making a dictatorship. I mean, I'm all in favor of extensibility always, but I don't know to which point people would really build this type of features themselves

cgrand14:01:41

I 👍 I think his premise his wrong at least twice: • technically upgrading the repl doesn’t scale below 1 tool, • socially that clojure doesn’t need tools because you can just hack them on the spot

ghadi15:01:40

I tried SPIRAL for the first time yesterday. So cool

ghadi15:01:47

first thing I did was (range)

ghadi15:01:35

thanks everyone but especially @cgrand & @volrath

volrath16:01:09

all feedback you can give me would be super appreciated 🙂

cgrand15:01:57

@ghadi be brave, try (iterate repeat (range))

cgrand15:01:50

it’s a bad case: assuming defaults (max length 10 and max depth 8), first value has one elision, second value has 11 elisions, third value has 111 elisions etc.

cgrand15:01:28

it’s going to send the GC trashing

cgrand15:01:41

In addition to depth and length, an upper bound on number of collections should be considered

cgrand22:01:58

@volrath a while back I mentioned I wasn’t happy with how the unrepl protocol handles further upgrades.

cgrand22:01:41

Currently on upgrade a :bye is emitted and we revert to a plain repl while providing many ways to still get messages on another connection. I believe it’s both complex and wrong.

cgrand22:01:40

A plain repl doesn’t allow to downgrade to a pair of bytes streams; you are stuck with chars streams.

cgrand22:01:41

Likewise it shouldn’t be able to escape from stream of unrepl messages (for output).