I’ve (re)watched Stu H “repl/sidecars” talk and I’m wondering to which extent using main/repl
is advisable.
It’s ok for a quick personal hack but it doesn’t compose well.
@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
@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.
As for having a main/repl
equivalent to share code with cljs, I’m not sure
the blocking/async chasm makes it difficult to share code that low
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
re. specialized repl tools, could you give an example?
the trick is that here is not such a thing as “the cljs repl” 🙂
^right...
re “specialized repl tools”, well you can’t have one tool that upgrades to have a pretty printer, one to have nicer exceptions etc.
all you can do is provide things and let the user build its own repl from this
got it..
definitely main/repl
could become a roadblock soon when moving in that direction
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
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
agree
I tried SPIRAL for the first time yesterday. So cool
first thing I did was (range)
@ghadi be brave, try (iterate repeat (range))
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.
it’s going to send the GC trashing
In addition to depth and length, an upper bound on number of collections should be considered
all feedback you can give me would be super appreciated 🙂
@volrath a while back I mentioned I wasn’t happy with how the unrepl protocol handles further upgrades.
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.
A plain repl doesn’t allow to downgrade to a pair of bytes streams; you are stuck with chars streams.
Likewise it shouldn’t be able to escape from stream of unrepl messages (for output).