3 ms·
I'm always surprised that Python doesn't have as good TUI libraries as Javascript or Rust. With the amount of CLI tooling written in Python, you'd think it had
by thomasahle 9mo ago
I'm always surprised that Python doesn't have as good TUI libraries as Javascript or Rust. With the amount of CLI tooling written in Python, you'd think it had better libraries than any other language.
- behnamoh 9mo agoit has, but python being single threaded (until recently) didn't make it an attractive choice for CLI tools. example: `ranger` is written in python and it's freaking slow. in comparison, `yazi` (Rust) has been a breeze. Edit: Sorry, I meant GIL, not single thread.
- ashirviskas 9mo ago> it has, but python being single threaded (until recently) didn't make it an attractive choice for CLI tools. You probably mean GIL, as python has supported multi threading for like 20 years. Idk if ranger is slow because it is written in python. Probably it is the specific implementation.
- behnamoh 9mo agoEven my CC status line script enjoyed a 20x speed improvement when I rewrote it from python to rust.
- foltik 9mo agoIt’s surprising how quickly the bottleneck starts to become python itself in any nontrivial application, unless you’re very careful to write a thin layer that mostly shells out to C modules.
- embedding-shape 9mo ago> You probably mean GIL They also probably mean TUIs, as CLIs don't do the whole "Draw every X" thing (and usually aren't interactive), that's basically what sets them apart from CLIs.
- acdha 9mo agoTextual looks really nice, but I usually make web apps so I haven’t tried it for anything serious: https://textual.textualize.io/ https://textual.textualize.io/
- sibeliuss 9mo agoTextual is A++. Feels a bit less snappy than Ink, but it makes up in all things with its immense feature-set. Seriously fun building apps of all kinds with this lib.
- thomasahle 9mo agoTextual is cook, but it's maintained by a single guy, and the roadmap hasn't been updated since 2023, https://textual.textualize.io/roadmap/ https://textual.textualize.io/roadmap/
- wonger_ 9mo agoBlessed was a decent one iirc: https://github.com/jquast/blessed https://github.com/jquast/blessed One reason for the lack of python might be the timing of the TUI renaissance, which I think happened (is happening?) alongside the rise of languages like Go and Rust.
- blks 9mo agoI’m using Textual for my TUI needs, it’s very decent.