| ▲ | Advice for the next 100 Rust GUIs(linebender.org) | |||||||||||||||||||||||||||||||||||||||||||
| 115 points by raphlinus 7 hours ago | 26 comments | ||||||||||||||||||||||||||||||||||||||||||||
| ▲ | dafelst an hour ago | parent | next [-] | |||||||||||||||||||||||||||||||||||||||||||
I am constantly surprised how few mentions of Slint there are in these sorts of articles. It's written by a team of funded ex-Qt alumni, is incredibly fast, and their DSL approach, while having a bit of a learning curve, makes laying out apps and managing data binding incredibly easy. They also bypass a big part of the issues mentioned in the article by just straight up using skia as a renderer on desktop (you can use others if you want) which gives software and gpu accelerated paths. I'm not associated with the project at all, but have been using it on and off for a couple years and have been quite satisfied. It's main weakness is rich text rendering which lacks maturity for complex layouts, but it is getting better all the time. | ||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||
| ▲ | skhameneh 3 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||
I'm building a custom GUI in Rust and it is such a slow process to build out. I find bits of the end result to be amazing, but it's all in the details that look like nothing compared to using something more "complete" with a larger UI community. I have some nice markdown rendering and phenomenally fast smooth scrolling - but I look at everything ahead of me, I don't even have text selection implemented yet, text wrapping and input cursor placement implementation wasn't that smooth to begin with. I have some amazing shader based animations, but the amount of effort that went into far exceed anything else I could have picked for a foundation. I started with Typescript and kept running into performance issues - it was fast to build and easy to scale, but kept becoming harder to maintain. With Rust it feels hard to build, hard to scale, but it feels like scaling and maintaining might be starting to get easier. The performance ceiling is a night a day difference though. | ||||||||||||||||||||||||||||||||||||||||||||
| ▲ | pnkzin1024 26 minutes ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||
When I made a computer use tool on macOS, my tool could find the right button easily, because well made apps have buttons with a role and a name. But I made my tool can find the right button by screenshots at bad apps. | ||||||||||||||||||||||||||||||||||||||||||||
| ▲ | dv_dt 4 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||
I found Qts signal/slot system very nice to work with to help with bridging the application logic to UI events and flows. Maybe rust's generic async is all you need, but I suspect that a GUI should probably have some opinion of how it interacts with async. | ||||||||||||||||||||||||||||||||||||||||||||
| ▲ | tauchunfall 2 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||
The "2026 Survey of Rust GUI Libraries" does not include Native Shell (nsh) [1] which is retained-mode and based on gpui-fast. Maybe because the code repository was started on October 11th, just 1.5 months ago. More than 2,000 commits later it already looks great. I think, they do the (AI) software engineering part very well [2]. After using GTK and JavaFX, and React for a decade, Native Shell makes me really excited. I never got warm with Flutter, the desktop applications were very slow on my MacBook. So I've been doing frontend development for more than 25 years, and I'm completely mind-blown for the last few weeks. Having a React background this feels very familiar, without the annoyances. Reactivity is inspired by Solid, styling by CSS (optionally with Tailwind syntax), the UI primitives are native views with layouting done by Taffy [3]. If you target web, the UI will be HTML. You can write the UI screens and components in Rust, but you can also use TypeScript/JSX, it will transpile and interpret it using Rolldown and QuickJS. It includes some components which are difficult to get right. A data table component, a rich-text editor component, and a plot component. As far as I can tell, they chose the currently best-known approach for them. [1] https://nsh.dev/ [2] https://github.com/longbridge/nsh/commits/main [3] https://nsh.dev/elements/ | ||||||||||||||||||||||||||||||||||||||||||||
| ▲ | jacoplane 5 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||
I just use Flutter for the UI and then use https://cjycode.com/flutter_rust_bridge/ | ||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||
| ▲ | weinzierl 2 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||
"You really want a video playing in a hardware accelerated layer when possible, and on low end devices it’s the only hope for getting smooth frame rates." I hit this recently trying to play video in Bevy efficiently. I thought that must be easy, but ended up with frames copied into a texture and composited by the engine, because the app owns just one swapchain and the video can't get its own layer. | ||||||||||||||||||||||||||||||||||||||||||||
| ▲ | soon_to_be_sb 13 minutes ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||
>Windows still has no clear native choice Wait, where did MFC go? EDIT: https://zendevy.com/en/tech/mfc-history-and-current-status-2... | ||||||||||||||||||||||||||||||||||||||||||||
| ▲ | amelius 5 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||
Or do as Mitcad does: use C++ to talk to Qt, and do the rest in Rust. | ||||||||||||||||||||||||||||||||||||||||||||
| ▲ | __benny__ 4 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||
Nice article, thank you for sharing it. I do want to nitpick this part however: > That’s been playing out architecturally in the choice between immediate mode and retained mode. Immediate mode is very appealing because it’s less total code and seems quite a bit simpler. And for some applications (most especially development support for games) it works well. However, I am concerned it won’t scale especially well. In short, it’s good at the first 90%, but it makes the second 90% harder. To be considered really production-ready, it has to establish stable widget identities to build and update the accessibility tree, and it has to reliably cache expensive intermediate artifacts such as text layouts (simple immediate mode often gets around this by cutting corners in text layout, which may be fine for gamedev). And of course, it pulls strongly towards a model of re-rendering everything every frame rather than exploiting layers in the compositor. It's a common criticism but I don't think it's based on anything other than preconceived notions about rendering being slow and doing a ton of caching makes everything faster. but neither seem to be backed up by any sort of empirical evidence. Anecdotally every imgui I've used has been lightening fast, and retained mode UI's like the browser, windows software, new Macos apps written in SwiftUI, etc, have performance problems. Egui has solved the accessibility problem and does a lot of caching: galleys, glyphs, and layouts are cached, packed texture atlases minimize GPU uploads, and it uses inputs & animation state to draw on demand. I also don't see how retained mode UI would scale better. Retained mode UI's are typically slow - they have a complex multi-pass general layout system and a ton of bookkeeping, which is why you typically need to keep updates to a minimum and ever-more-complex change tracking systems are being built to reduce updates to a minimum. This doesn't scream scalability to me - whereas in an imgui there is a baseline overhead but adding more widgets or more frequent updates have a negligible performance impact. the worst case for retained mode is a UI which has many widgets frequently updating multiple times a second, which means you approach the update and drawing of imgui but with the additional overhead of the change tracking, bookkeeping, etc of the retained system. Also there is nothing fundamental about imgui layout systems being limited, and in my experience it's not that difficult to build custom widgets to implement pretty much anything. Retained mode layout systems are usually declarative, where you describe a layout and hope that the system is flexible enough to support what you want, whereas with an imgui you can just directly draw and shade geometry to get whatever you want. Otherwise, great article and I look forward to the future of Rust UI. | ||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||
| ▲ | vkaku 6 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||
I think the Rust GUI scene is fast catching up. After using ArtCraft on my PC, I was amazed at the responsiveness and expressiveness of the GUIs being implemented and I feel they've come a long way. I was used to running slow JS based apps all the time, any of these native ones feel like an upgrade to me. Having said that, I think we've come to an era where concerns like these can be quickly addressed and responsiveness tested, so looking forward to more of this kind of analysis and more usable applications in the near future. | ||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||
| ▲ | JohnAaronNelson 5 hours ago | parent | prev [-] | |||||||||||||||||||||||||||||||||||||||||||
Arguing about coding languages seems quite passé. If there is an imperative reason to use something for performance reasons, I’ll bite. Otherwise, it seems silly. The prompts will not differ much and the rewrites are trivial. What matters to me is the experience, not the tech. | ||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||