Kruci: Post-Mortem of a UI Library
Key topics
The author shares a post-mortem analysis of their abandoned TUI library, Kruci, discussing the technical challenges and lessons learned, sparking a thoughtful discussion among commenters about UI development and design trade-offs.
Snapshot generated from the HN discussion
Discussion Activity
Moderate engagementFirst comment
12h
Peak period
10
12-18h
Avg / period
3.5
Based on 14 loaded comments
Key moments
- 01Story posted
Sep 4, 2025 at 2:22 AM EDT
4 months ago
Step 01 - 02First comment
Sep 4, 2025 at 2:08 PM EDT
12h after posting
Step 02 - 03Peak activity
10 comments in 12-18h
Hottest window of the conversation
Step 03 - 04Latest activity
Sep 7, 2025 at 8:25 AM EDT
4 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
Unless that RwLock is in contention to get acquired every frame I doubt it will add anything significant to the frame time. Worrying about things like this without profiling can cause a lot of unnecessary complexity when planning abstractions in Rust.
Furthermore- UI updates are usually all run from the same single thread, so it’s unlikely the other widgets could even contend for that lock! You might be able to get away with the lock approach and you may even be able to use Rc<RefCell<_>>, which would get a little speed up.
:+1: - it was mostly about "damn, it _feels_ like there should be a better way".
> You might be able to get away with the lock approach and you may even be able to use Rc<RefCell<_>>, which would get a little speed up.
In this particular case that'd be a bit more awkward, because in the actual game the UI is driven by async fn (the rendering itself is sync, of course, but waiting for input is async, and both happen as a part of the same function).
`spawn_local()` could be a good enough solution for that, though.
Yeah, totally. I have those same feelings. It's hard to fight it because `.lock()` and friends do _feel_ heavy!
Screenshots use Berkeley Mono (my "daily driver" font).
Reminds me of Turbo Vision, a TUI toolkit from 1990's: https://en.m.wikipedia.org/wiki/Turbo_Vision
It did not have shader nodes, but it run very well on 10MHz computers with a single megabyte of RAM (or less).
I appreciated the explorations of the complexities of widget rendering, and syntax construction, and explorations of possible solutions and their tradeoffs, with ultimately a reasonable conclusion from the author that it wasn't worth their effort.
This was a great introduction to the design space of TUI libraries. Thanks!
> I think it's okay to both explore and to give up, other paths await.
100%, and thank you for taking us on this enlightening journey. Too much is lost to silent "failure"
Even armed with a library like charms or bubbletea in Golang, sometimes its just amazing how all the internals "clicked" together, to render layouts and widgets.
Problem is when we think UI frameworks we usually run in something that handles a lot of things for us: browser, xorg, wayland etc. You don't get in terminal, so a lot of times TUI frameworks result being a thin abstraction on top of a render-loop.
Then you can't slap something like MVC pattern on it because that isn't how terminal app works. The event handler pretty much has to be global, even if the framework provides some focus management capabilities.
I've tried using different languages and frameworks for thing that I'm working on and pretty much ready to comeback to ratatui.
Whoa a programming game. Interesting :D