Remix.run Logo
▲ 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.

▲Onavo an hour ago | parent [-]

They are not free. That's a pretty big barrier to adoption. When QT was launched there was no good alternative for cross platform if you want to support Linux.

Honestly, if Slint doesn't pivot or provide non GUI lib services, I would expect an "Our Incredible Journey" blog post soon.

The only way I can imagine them surviving is to go into aerospace and automobile where the barriers are entry are mostly around certification and compliance. There's no moat anymore in consumer UI libs.

▲dafelst an hour ago | parent [-]

On desktop and mobile, they're free for open source products and for any company with less than $2M in funding or revenue, and pretty reasonably priced otherwise.

Embedded seems to be where they're focusing, as they do charge royalties for that, so you may be right.

▲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/

▲himujjal 2 hours ago | parent [-]

What is wrong with Dart? I genuinely want to understand why such a framework exist in the first place? Why would someone write UI in Rust? That too in a framework meant for Dart with excellent ecosystem.

Performance? What is that one problem that Rust solves that Dart cannot?

If this is for fun. Great. But if this is seriously taken to prod, well.

▲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.

▲adastra22 2 hours ago | parent | next [-]

Egui solving accessibility is news to me. Has something changed in the last year or two?

▲shooly 2 hours ago | parent | prev [-]

First you complain about lack of empirical evidence in discussions about rendering, and then you yourself argue against retained mode UIs using purely anecdotal evidence.

You are also often comparing imgui/egui - a specific implementation of the immediate mode concept to the whole concept of retained mode UI.

> in an imgui [...] adding more widgets or more frequent updates have a negligible performance impact

Absolute nonsense.

> Retained mode [...] hope that the system is flexible enough to support what you want, whereas with an imgui you can just directly draw and shade geometry

At least in browsers you can just use <canvas> or <svg>. If you're implementing retained mode in a custom application - well it also must have some way to draw things on the screen.

▲__benny__ 2 hours ago | parent [-]

I'm not arguing against retained mode UI systems, I'm arguing that some of the criticisms of imgui's are unfounded. A lack of empirical evidence is relevant for that.

I used Egui as an example because that's relevant to the shared article. When I say "imgui" I am talking about the paradigm, not Dear Imgui.

In manu retained mode UI systems you can break out of the paradigm with a Canvas element, but that is quite different from an imgui - it's akin to using a 2d drawing API like Skia.

> Absolute nonsense.

How so?

▲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.

▲skhameneh 3 hours ago | parent [-]

ArtCraft mostly uses egui and without egui there isn't much that would be considered mature, even GPUI doesn't seem to have the same level of completeness.

I suppose what I'm getting at is there isn't much more movement that I've noticed as far as professional UI development. I thought there would be a lot more than there is.

▲the__alchemist 3 hours ago | parent [-]

Concur. I started with EGUI years ago when there were fewer options. It still seems to be one of the most mature, reliable, and flexible. I'm happy continuing to use it for new projects, with an open mind towards experimenting with GPUI and others.

▲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.

▲deterministic 2 hours ago | parent | next [-]

I completely agree. I stopped caring about programming languages now that AI writes all the code. And AI’s are really good at C++ so that’s my weapon of choice.

▲palata 4 hours ago | parent | prev | next [-]

Given the price of RAM, I'd say it's nice to think about performance?

▲wmf an hour ago | parent | next [-]

But there are more mature languages that are in the same performance class as Rust (e.g. C++, ObjC, Swift). Rust with an immature toolkit may be worse than WinUI + C++ or SwiftUI + Swift.

▲bigyabai 32 minutes ago | parent [-]

> e.g. C++, ObjC, Swift

All of these languages have their own drawbacks that Rust doesn't. C++ is a toolchain management nightmare, ObjC is antique, and Swift's core team was called "toxic" by Lattner himself.

Which is not to say that Rust is a perfect language (especially for GUIs) but it's no wonder we ended up in this situation. The 14 competing standards all drove themselves into a lake.

▲kccqzy 39 minutes ago | parent | prev [-]

It is possible to write software that conserves memory in almost any language. It’s easier in some languages than others. But AI makes it so that the difference between languages matters less.

▲bliteben 3 hours ago | parent | prev [-]

we've been circle jerking ever since win32 and vb6.