Advice for the next 100 Rust GUIs
29 points by bitshift
29 points by bitshift
I love Zed, not much of a rust guy at the moment, but maybe some day. Anyway, this:
There’s evidence that the LLM cost of writing Rust code is not significantly higher than other languages, and there is reason to believe that in large codebases, Rust will be more maintainable because its type system helps enforce invariants.
caught my eye. I was actually intrigued to go see the “evidence” (https://danluu.com/pl-tokens/). I actually didn’t find much evidence at this point. The article even concludes with “who knows?”. It’s more of an attempt to validate the claim, and ironically it does it domains (back end type algorithms) where static languages have been more prevalent, and doesn’t test much in the domains (user facing stuff) where dynamic languages have tended to thrive.
I would be curious how compelling some of the others felt the “evidence” was. I actually liked the evidence article a bit (I.e. was grateful for the ref). It just felt like this author is reaching if they see it as a support for what the hope is here.
what caught my attention to this is the obsession with a "maintainability" from types that rarely proves itself. The first and most important characteristic of a UI interface is solving the users problems. Most software engineers have no clue how to do that and types won't help with that but they think that it is enough to choose a UI/UX library. It is not.
These are two separate issues.
You may know how to solve user problems well, but struggle with implementation (that may be slow, crashy, prone to race conditions, or unable to support the UX you want).
Or you may have the best UI library in the world, but be an LLM that decides to put every app feature in one toolbar, alphabetically.
Most software engineers have no clue how to do that and types won't help with that but they think that it is enough to choose a UI/UX library. It is not.
Getting a compile-time error when a function expects a different shape of argument inputs, or getting a compile-time error when a caller expects a different result type -- is a huge benefit for refactor-often style of software development, at least in my experience. And I I think will continue to be more and more prevalent in human-with-LLM style) of dev.
I do not think it depends on specific UI characteristics. The fewer unsafe type casts, the fewer 'this can be validated at run-time-only' -- the better.
Yeah I think it's actually PHP programmers who have the best track record of iterating on web UI, versus say Python, TypeScript, Go, or Rust programmers.
Because they hit F5 and they use their visual brains to tweak how it should work quickly. PHP reloads better than any of those languages.
The iteration loop is what matters for UI, not the type system. And it's not just types - there are no automated TESTS for whether a UI is designed well.
I don't think the token cost of generating the initial code is necessarily the bottleneck or even the most important cost. Instead the quality of the generated code, and how well the model can maintain and make changes to the codebase over time, feel like the pertinent questions.
In my experience, the frontier models have gotten a lot better at Rust compared to early 2025. I don't know how much of that comes from Rust-specific pre-/post-training and how much carries over from training in other domains/languages.
I haven't asked frontier models to write enough Rust UI code to know how well they'd maintain a complex codebase built with a framework like GPUI over time. What I'd be curious to see measured is how well agents fix bugs and add new features - without introducing regressions or making the codebase hideous - in an existing UI app across a few different UI stacks. That would tell us more about the cost of the language + UI framework than the initial token cost alone.
I haven’t seen good research on the topic, but anecdotally I think people like this idea because in practice very few engineers can hand code Rust and there are trivial speedups on the table when converting many things from a scripting language to Rust, so they prompt an LLM to rewrite something in Rust and get a working dribble castle that they can’t read and since they can’t read it they don’t notice flaws in it and assume it all works correctly. As a pre-AI Rust-knower I’ve been on the receiving end of a handful of these Rust rewrites. They’re usually not good. Working but not idiomatic and often far from beautiful. Traits tend to be underused and proc macros even more so.
Incidentally I’m one of few people that shipped a Druid app to end users and I think extremely highly of Raph’s work, I’m just not in strong agreement on this particular claim.
Accessibility is not exactly solved. AccessKit may be very good, but its very nature is being a bolt-on. It keeps a yet another copy of the UI control tree internally. A unified rendering/a11y tree is possible, but AccessKit doesn't fit that paradigm AFAIU.
I like what he has to say about modularity.
One of the things the web ecosystem has done really well is encapsulation of some of the hard parts of GUIs. If you want to build your own web framework, you don't have to worry about opening a native window, or rendering text, or making widgets accessible. You get all that for free! That lowers the barrier to entry and allows the crowd to thoroughly explore the solution space.
The downside of thoroughly exploring the solution space is we got thousands upon thousands of different web frameworks, and it took a decade for things to settle. But on the whole, I think the competition of ideas was worth it.
One of the things the web ecosystem has done really well is encapsulation of some of the hard parts of GUIs. If you want to build your own web framework, you don't have to worry about opening a native window, or rendering text, or making widgets accessible. You get all that for free!
You also get all that for free in every historic desktop GUI toolkit since the 90s and likely 80s though? You don't have to worry about text rendering in Qt, GTK, WxWidgets, FLTK, Delphi or whatnot. Here's a basic Motif UI code from 1989: https://www.cs.nmsu.edu/~pfeiffer/motif/sortgui.uil
I think the point is you have to worry about that to implement a new desktop GUI, but not a new web UI framework.
We don't need 100 new Rust GUI toolkits. We need stable and mature ones.
With AI, anyone can produce a GUI framework over a weekend. That's the easy part. The hard part is maturity: years of API stability, and enough users that someone can bet a product on it.
I am reworking my previous side-project (ReactJS, ReactNative (for mobile), Java) into Rust everything where possible, and typescript for browser (now Svelte)
The LLM I am using is $13 per month (5 hours a day limit) - GLM-5.3-flash. And I also run a local quantized Qwen model when my GLM limit expires.
Agent choice is important, I am using Hermes for now (started with open code), and I tried Dirge -- but that one did not work for me, way too slow.
I am not great yet at idiomatic Rust, but I am a C++ programmer (and Java, and Erlang) , so generics, references, mutable+immutable -- I am very familiar with. I like Rust's idioms for initialization, returns, matching.
I am glad sofar with the setup. I have to ask the LLMs multiple times to do architectural code review (I do this periodically) and spend effort on better logging, removing duplicate code through leveraging of generic programming and trates, etc. It seems to work well.
I am forcing myself to manually code some changes, though -- and it is quite hard, as I have to learn 'somebody else's code' (even though it was created from my prompts, directions, snippets, etc.). So for every like 2h of LLM effort -- it is about 8-12 hours for me to understand what was done (this is not a linear metric, actually growth with complexity) -- so overall LLM is not giving me the 'time advantage ', so to speak, as I still spend a lot of time in the code (but not on writing, more on comprehending/reviewing/testing changes)
I got the LLM to do for me Rust Tauri + Svelte (so a desktop + web) app -- this was a huge help, otherwise, I would probably just end up with a 'default' web app only, but having the LLM doing the Tauri boilerplate, then creating a bridge to integrate with Playwright for testing -- was a big help, it would take me months to figure that boilerplate out on my own (including idiomatic directory structure, build with CI/CD, etc)
If I had to name a particular negative for Rust in the age of LLMs, it's that the compile+test-change cycle is very long for me. Crate building + linking takes minutes on my hardware, so it makes my brain switch to something else, and then I lose the train of thought.
The OP article is a reference to Blitz, and it has a reference/overview of a bunch of rendering engines -- I never had a current picture, so this is a good reference to keep eyes on. This is a complex space with layout engines, constraint-based optimizers, and I think it is correct that the GUI kits are evolving into these things, rather than OS-specific UI API wrappers. Because at the end of the day, the OS specific wrapper APIs are going to be too complex to deal with when it relates to layout/theming. And coming up with type-safe ways of abstracting screen sizes, theming, user-interaction flow, valid-vs-invalid UI states (currently not done to my knowledge in Qt) - I think would be very useful. Rust, with a garbage-collection-free runtime but a strong type system and safety, should be good for this.