
ImTui: Immediate Mode Text-Based User Interface - ingve
https://github.com/ggerganov/imtui
======
onetoo
While the interfaces this creates look absolutely gorgeous, I struggle to see
actual use cases for this outside of toy examples and browser replacement apps
that are going to be used by no one.

If that is all that this is intended to be, then great, good job, looks
amazing. If not, can anyone enlighten me about an actual use case for this?

~~~
ggerganov
I am looking for a nice use case for the library, but so far I agree I haven't
found one. I believe it can be mostly useful for making terminal
development/debug tools quickly.

When you say the apps created with ImTui will be used by no one, what do you
think is the reason? What are the features it lacks compared to other text UI
libraries? On the contrary, I believe it can be used to create all kinds of
terminal applications - even useful ones.

~~~
onetoo
Good question. I suppose I am basing my argument on text-based GUIs as a whole
instead of this library in particular. I have no opinion about this library
vs. other text UI libraries, other than the fact that it is visually stunning.

In my experience with TUI apps (RTV, IRC clients, even vim, as much as that
pains me to admit after the days I've spent fiddling with my vimrc.), it was
always worse UX compared to a native GUI version, for some definition of
native GUI that includes browsers/electron. I don't mean literally _no one_
will use TUI apps, but I don't see a killer use case for them.

To refactor my question: What is the use case for TUI that isn't better served
as a native GUI or proper CLI?

Sure, GDB with a TUI sounds neat, but I don't see how it wouldn't be better
served as a native GUI (Which seems to already exist[1]. Neat).

[1] [https://www.gdbgui.com/](https://www.gdbgui.com/)

------
otterpro
ImTui is really interesting, and I hope it gets adopted by other projects. My
idea would be to implement something like `htop` or `mc` with this and make a
cool cross-platform terminal UI app.

------
realharo
Does it only redraw things on change, or fixed at 60 FPS no matter what? Does
it redraw the whole screen, or only the parts that have changed?

A lot of the screens show FPS info, so it's not immediately obvious.

~~~
thristian
This is an implementation of the ImGui interface on top of ncurses. "Frames
per second" doesn't really mean anything for ncurses, so I wouldn't trust it
terribly much.

Basically, ncurses presents a "framebuffer" of coloured characters for the
application to draw on. When the application says "draw this to the screen",
ncurses compares the current framebuffer to the previously-drawn framebuffer,
and tries to encode the difference in the smallest batch of terminal-control
sequences it can find - it's a bit like React or Elm in the browser. Even if
the application "redraws" the screen a million times a second, if there's no
visible change, ncurses will do exactly nothing.

~~~
ggerganov
Very well explained. Thanks

------
qubex
Ncurses: The Next Generation?

Very impressive.

------
1ark
Superb! The HN reader is really good.

