Terminal-Print
Terminal-Print copied to clipboard
A couple of improvements to the framework
I'm playing with writing own simplistic Term::UI framework and decided to base it on your work. But a couple of changes was needed to make this possible. So, here is the result.
Besides, I have implemented basic support for terminal size change by allowing on-the-fly resetup of Terminal::Print instance. It's up to the user application though to react on SIGWINCH and initiate the reconfiguration.
Generally speaking, a lot of these changes result in pessimization. I'm certainly open to making a few things easier -- I've thought of creating a widget library of my own but just haven't had time, so the idea of e.g. allowing resizes makes sense to me -- but it's important to allow other users of the library (who want to make e.g. animations) to have fast paths.
Sorry, I don't get it what kind of pessimization do you mean? Besides, it looks like my changes don't break compatibility as tests are passing and examples are running.
Upd. See your comments now. To late for today, will consider tomorrow.
I have comitted a few fixes. Seemingly I missed rpg-ui when tested examples, it was broken by the constrain on char in Cell. Implemented a quick workaround for it by making set-span accept same parameters, as change-cell. Otherwise it would require more time to rewrite parts of the example code which I don't have time for. But making set-span accept string key alongside with char would actually make it an acceptable fix.
Hey @vrurg and @japhb , I'm really happy to see this discussion. Sorry for joining late!
I think this PR has some real merit but it will take me until the weekend at least to give it a proper analysis.
In general I think resolving surprise issues and random discordia is a reasonable offset for small dips in performance. Especially since Terminal::Print keeps getting faster based on improvements to raku over any explicit attempts on our own :)
Also I think this patch might be a nice (near) end cap on the V1 API -- which might have too much sugar to support the real potential of its true bubbly personality anyway :)
@vrurg all that I may ask is that you consider joining the 21st century and sparing a few extra characters on your Term::UI library to join us in Terminal::* ;) ;) ;)
@ab5tract Thanks for the good words!
A few notes. Since when it all started, I have renamed Term::UI into Vikna. Mainly because Term::UI in Perl means different thing but also to have one-worded project name. Besides, the ideology of the project shifted significantly towards even-driven and parallelized paradigm. Also I have switched to own Canvas concept instead of using grids...
I mean, eventually, all I need of Terminal::* is Terminal::Print::Commands and Terminal::ANSIColor. So, this PR is basically orphaned, I don't think I would have time to do any changes in it any time soon. OTOH, any help with Vikna would be appreciated! :)