[HN Gopher] Ratatui
       ___________________________________________________________________
        
       Ratatui
        
       Author : tosh
       Score  : 176 points
       Date   : 2023-12-10 18:28 UTC (4 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | jordanreger wrote:
       | Extra points for the awesome demo GIF!
        
       | treesciencebot wrote:
       | Seems like especially for the last year or so, there have been a
       | significant amount of interest in single-language oriented
       | (instead of a single core library w/N language bindings, winking
       | at a particular one) TUI libraries that are getting better and
       | better (potentially because some of them were able to attract VC
       | money). Two of them off top of my head is Textual (by
       | textualize.io) for Python and BubbleTea (by charm.sh) for Go.
        
         | lc9er wrote:
         | Spectre.Console for dotnet.
        
         | pjmlp wrote:
         | For me all of them have Turbo Vision for Turbo Pascal 6.0 in
         | MS-DOS, circa 1990, as baseline to beat.
         | 
         | Or the various Clipper based TUI for business data entry, as
         | another example.
         | 
         | Since they are catching up with the past, they should improve
         | upon it, not just revisit it.
        
           | kragen wrote:
           | is there a good publicly available video that demonstrates
           | what is good about these user interfaces, or alternatively,
           | something that a non-expert user could run in dosbox to get a
           | feeling? is the notably excellent part the user experience of
           | the things that people built, or the library calling
           | interface, or both?
           | 
           | business data entry seems like something that probably
           | requires an experienced user running the application to show
           | what's good and bad about it
           | 
           | my own 'baseline to beat' is fractint, which is pretty much
           | unchanged in xfractint, which you can install from apt on
           | debian. you just have to imagine it running fullscreen on a
           | svga
        
             | mixmastamyk wrote:
             | Why a video? Here's a recent port:
             | https://github.com/magiblot/tvision
        
               | jrumbut wrote:
               | The video is to display what an expert can do with it, if
               | I understand correctly.
               | 
               | In undergrad, I worked nights in a warehouse where most
               | things were managed by a very complicated TUI program.
               | 
               | The learning curve was quite steep. What someone could do
               | after 6 months of using it was completely different to
               | what a beginner without a trainer could do. You wouldn't
               | be able to see what is good about it by just setting it
               | up on your own computer and playing with it (and of
               | course you probably don't have a busy warehouse to
               | manage).
        
               | mixmastamyk wrote:
               | May be so, but Turbo Vision was not a unique interface
               | paradigm. It worked just like any CUA application of the
               | era, with dialogs and widgets, tab/funcion keys etc. Its
               | "raison d'etre."
        
               | kragen wrote:
               | perhaps you intend to assert that turbo vision
               | implemented the
               | https://en.wikipedia.org/wiki/IBM_Common_User_Access
               | standard, or made it easy for applications to do so
               | 
               | if so, that's news to me
        
               | mixmastamyk wrote:
               | Yes it did to a large extent, although I think some of
               | the function key defaults were a bit different, probably
               | from older Borland apps.
               | 
               | But by and large converging on a singular CUA/MDI
               | interface from Mac OS, Windows, IBM, Motif, QBasic, and
               | TVision, in the late 80s.
               | 
               | While not everyone got there 100% it did help
               | tremendously that one could sit at a Mac/Win/Dos PC, Unix
               | Workstation, or IBM mainframe and understand the
               | application level interface immediately.
               | 
               | We're sadly losing that as "smart" people decide to hide
               | things from "dumb" people in terms of interface design.
        
               | kragen wrote:
               | compare these alternatives:
               | 
               | - spend an hour comparing recent turbovision-like
               | libraries. spend twenty minutes building one. spend two
               | hours working through the tutorial. spend sixteen hours
               | building a new application using the library. use it. get
               | a feeling for what an application using the library
               | written in a weekend by someone with no experience is
               | like. (this is my understanding of the alternative you're
               | suggesting)
               | 
               | - spend eight minutes watching a video of a domain expert
               | using a user interface built in turbovision by
               | programmers experienced in turbovision, who refined that
               | user interface over years. (this is what i was asking
               | for)
               | 
               | which one do you think provides more insights into the
               | textual user interface design space
               | 
               | which one provides more insights per minute
        
               | mixmastamyk wrote:
               | Well, maybe you could spend a minute looking at the
               | screen shots at the link and realize it works like every
               | typical desktop app anyone has used since 1988.
               | 
               | TV is a classic interface in every sense of the word--it
               | isn't pushing boundaries as perhaps you are looking for.
        
               | kragen wrote:
               | i notice that you haven't answered any of the four
               | questions i've asked in my previous two comments, instead
               | telling me a lot of things i already know (and also
               | linking tvision, which is an interesting project, thank
               | you)
               | 
               | to me this seems surprisingly discourteous
               | 
               | what do you hope to accomplish by such an abrasive
               | interaction style
        
           | karmakaze wrote:
           | What more is there? It seems like a feature-complete set once
           | there's mouse support. I suppose adding graphics for iTerm
           | and such could be extras.
        
             | deadbabe wrote:
             | I think mouse support would defeat the purpose of a
             | terminal UI.
        
       | enricozb wrote:
       | I really wish there was a more react/swiftui-esque TUI library.
       | One day I'll get around to fixing the fundamental flaws in my
       | crate [0]
       | 
       | [0]: https://docs.rs/intuitive/latest/intuitive/
        
         | nicoburns wrote:
         | You should check out dioxus's TUI support
        
         | withinboredom wrote:
         | If you like php, there's termwind that combines html +
         | tailwind. Combine that with something like the swytch
         | framework, and you've got a pretty similar to react workflow
         | (components, still working on hooks, tui, etc).
         | 
         | The things we work on when we are bored...
        
         | airstrike wrote:
         | Love the SwiftUI inspiration. Swift has its warts but after
         | spending a couple months deep in SwiftUI I miss it dearly when
         | I'm writing GUIs anywhere else
        
         | srott wrote:
         | React & tui
         | 
         | https://www.npmjs.com/package/react-blessed
        
       | fnordpiglet wrote:
       | Use ratatui in all my tooling, it's great. Very simple immediate
       | mode api that eschews most of the complex framework insanity.
        
       | varbhat wrote:
       | ratatui is very good Rust TUI toolkit right now. But, it doesn't
       | support mouse click events yet[0]. I hope that they implement
       | this feature as i think it's critical to some TUI applications.
       | 
       | [0]: https://github.com/ratatui-org/ratatui/issues/273
        
         | Varimpls wrote:
         | I think this application uses click events
         | 
         | https://www.github.com/mrjackwills/oxker
        
       | neverrroot wrote:
       | I love TUI. Nothing beats its clean UI, focus, speed and the
       | resulting productivity. Learn a few shortcuts and fly. We need
       | more TUI apps.
        
         | baq wrote:
         | The worst part is there's absolutely nothing stopping anyone
         | from making the same principles work in the browser. Zero.
         | Nada. It's trivially proven by compiling apps to wasm and
         | running in a terminal emulator but there's nothing stopping
         | anyone from building react-terminal-like or whatever except
         | that... I don't even know what since we've got
         | https://github.com/Textualize/textual-web.
         | 
         | People have thrown out decades of UX research and engineering
         | out of the window because it isn't cool anymore. Makes me sick.
        
           | Aurornis wrote:
           | > People have thrown out decades of UX research and
           | engineering out of the window because it isn't cool anymore.
           | Makes me sick.
           | 
           | Most people don't want to browse the web with a keyboard.
           | 
           | Traffic to many websites primarily comes from mobile devices
           | with touchscreens.
           | 
           | It has nothing to do with being "cool". Terminal interfaces
           | are great for those of us who spend a lot of time attached to
           | the keyboard, but most people don't operate like that.
        
             | speed_spread wrote:
             | It's not about the keyboard, it's about discoverability and
             | standards. Designers think their ideas are sooo good that
             | they warrant overthrowing previously established norms of
             | computer interaction. You now need to re-learn where things
             | are for every new "application".
        
             | sshine wrote:
             | > _Most people don't want to browse the web with a
             | keyboard._
             | 
             | You can easily add mouse support for the equivalent of a
             | TUI.
             | 
             | Unlike CLIs (and shells) which requires learning a language
             | and memorizing, TUIs give you relevant options.
             | 
             | > _most people don't operate like that_
             | 
             | I'm convinced that if more UIs were simpler state machines,
             | computers would be easier to use for non-programmers.
        
         | 12_throw_away wrote:
         | I also love TUI, and ratatui in particular, but ... are there
         | any TUI frameworks with accessibility features? Is that even
         | possible?
         | 
         | I worry that we've taken the TTY, a foundational accessibility
         | device, and found a way to slap an inaccessible technology
         | layer on top of it.
        
         | davidcox143 wrote:
         | We're working on a new TUI for managing local and remote
         | executions of optimization solvers like CBC, HiGHS, and our own
         | hardware-accelerated solvers [2].
         | 
         | Ratatui is a delight to work with. It uses immediate mode
         | rendering [3] which feels very intuitive compared to other TUI
         | frameworks.
         | 
         | [1] https://github.com/integrated-reasoning/napali [2]
         | https://reason.ing [3] https://ratatui.rs/concepts/rendering/
        
       | chaosprint wrote:
       | great to see tui-rs can be continued in this way!
       | 
       | should try ratatui for glicol-cli at some point.
       | 
       | you can have a look on how I use tui for music live coding:
       | 
       | https://github.com/glicol/glicol-cli
        
       | binary132 wrote:
       | Stuff like this is cool, and I like a nice TUI, but it's really
       | not for everyone. It always makes me think about how I'd like
       | GUIs to be more like the TUIs I know and love, and what a pain it
       | seems to be for the world to converge on good, simple GUI
       | toolkits that aren't HMTL+JS. Please don't say QT or GTK+....
        
       ___________________________________________________________________
       (page generated 2023-12-10 23:00 UTC)