-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[meta] ergo_term subcrate #9
Comments
Also see my comment from the quicli issue killercup/quicli#11 |
I would suggest that this should be opt-in, since it will be potentially large. I think there might be more work to do on the building blocks before starting to make a TUI crate, but maybe this is a good place to coordinate. |
I think that the best inspiration for this should be https://pdcurses.sourceforge.io/doc/index.html. It supports lots of platforms and will have the platform-specific code we need. I'm going to read about it now. |
Also check out the termstyle crate, which I wrote to start to solve this problem. One of the main goals of termstyle is to make it not only easy to write formatting in code but also write it in a Personally, I feel that treating the terminal as the following is way too complex to be ergonomic:
The majority of CLI applications only need a things (IMO):
progress bars are nearly impossible to test, but the others could be pretty trivially tested if there was a simple way to express the format that wasn't copy/pasting raw formatting bytes (which are different on different platforms!) Doing full terminal interaction is basically a creating a GUI, which is out of scope for the |
I think it is possible to solve both problems in a single crate, but I agree that this shouldn't be the ergo crate. I way I think it should be structured is: single crate providing terminal functionality (quite complex, call it curses would prioritise 0-cost, whist ergo would provide perhaps non-zero cost abstractions on top to make it ergonomic. What do you think? |
Ok my suggestion for making progress is as follows We should make the first library totally about platform abstraction, with the lowest cost possible. We should focus on providing all the functionality we can, with ideally 0-cost over the system calls. We should always provide the fastest way to do things, even if there is some API overlap. This can be handled in a higher-level ergonomic crate on top that knows how to delegate the the right methods.
It would be good if we could make using a terminal as easy as clap/structopt makes handling command line args. But it's a harder and more risky goal than CLI parsing because there is more variation between platforms and more platform-specific code is required. |
Hey, sorry I've been absent. My 6mo old spilled coffee on my laptop a month ago and I'm just getting back up to speed. I haven't read your comment, but I wanted to leave a couple of additional crates for
Edit: it's possible this is actually the domain of |
This is a meta issue for the future
ergo_term
subcrate. This dicussion should find out:ergo
directly (or should someone need to use it as a separate dependency).The text was updated successfully, but these errors were encountered: