Advice for the next 100 Rust GUIs

本文为原文前 6,000 字符的节选翻译,完整内容请查看原文。

Advice for the next 100 Rust GUIs

Advice for the next 100 Rust GUIs Raph Levien, November 21, 2026 This is a followup to Advice for the next dozen Rust GUIs, published 4.5 years ago. The world is different in many ways, but some of the advice there is still valid. There have been roughly 20 Rust GUI toolkits announced since that blog post (see 2026 survey), but also a recent rapid acceleration of interest in Rust GUI, fueled by AI.

这是对 4.5 年前发布的《给未来十几个 Rust GUI 的建议》的后续文章。世界在许多方面已经发生了变化,但其中一些建议仍然有效。自那篇博文发布以来,大约有 20 个 Rust GUI 工具包被发布(见 2026 年调查),而且在人工智能的推动下,人们对 Rust GUI 的兴趣最近也在迅速升温。

Rust GUI is still compelling The motivation to build GUI apps in Rust remains strong. Many shipping GUI apps suffer from poor performance, especially when built with cross-platform technology. GUI toolkits shipped by platforms have largely stagnated, and system vendors remain uninterested in solving the cross-platform problem, so Electron has grown in popularity. RAM remains expensive and the focus is shifting to mobile, so bloat has real consequences. Building high-performance UI in Rust is a practical alternative.

Rust GUI 依然引人注目。用 Rust 构建 GUI 应用程序的动力依然强劲。许多已发布的 GUI 应用程序性能不佳,尤其是在使用跨平台技术构建时。平台自带的 GUI 工具包大多停滞不前,系统供应商对解决跨平台问题依然不感兴趣,因此 Electron 的受欢迎程度有所增长。内存依然昂贵,且重心正转向移动端,因此软件臃肿会带来实际后果。用 Rust 构建高性能 UI 是一个切实可行的替代方案。

Adoption of Rust UI in the past few years has been slow. Few flagship apps use Rust for their UI. One of the most notable is the Zed editor, built on their own GPUI framework. It proves that shipping Rust UI is practical, and indeed, GPUI is emerging as a major choice for AI-driven rewrites, most notably Discord. My personal sense is that GPUI is well suited to the Zed use case, and shipping in a real project boosts its visibility and credibility quite a bit, but it’s not necessarily the ideal choice for more general purpose applications.

过去几年,Rust UI 的采用速度缓慢。很少有旗舰级应用使用 Rust 来构建 UI。最著名的例子之一是 Zed 编辑器,它构建于自有的 GPUI 框架之上。这证明了发布 Rust UI 是可行的,事实上,GPUI 正成为人工智能驱动重构的主要选择,最显著的例子就是 Discord。我个人的感觉是,GPUI 非常适合 Zed 的用例,在实际项目中的应用极大地提升了它的知名度和可信度,但它未必是更通用应用程序的理想选择。

Among other things, its 2D rendering engine is well suited to a text editor, but lacks full gradient support, blending, filters, and other features expected of a renderer in the same class as Vello or Skia. The reasons for slow adoption may be melting away. Writing Rust code is harder than languages more traditionally used for UI (TypeScript, Kotlin, Swift), and finding engineers skilled in both Rust and UI is challenging. But AI is changing the game.

除其他因素外,它的 2D 渲染引擎非常适合文本编辑器,但缺乏对渐变、混合、滤镜以及 Vello 或 Skia 同类渲染器所期望的其他功能的全面支持。采用缓慢的原因可能正在消失。编写 Rust 代码比传统用于 UI 的语言(TypeScript、Kotlin、Swift)更难,而且寻找既精通 Rust 又精通 UI 的工程师也充满挑战。但人工智能正在改变游戏规则。

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. So if all languages have roughly the same cost, then why not go with one that has a dramatically better combination of safety and performance? For these reasons, Rust is rapidly becoming the language for AI rewrites of existing codebases. But there is still no consensus on the strategy for the UI layer. I predict there will be a small explosion of trying lots of different things.

有证据表明,编写 Rust 代码的 LLM 成本并不比其他语言高出多少,而且有理由相信,在大型代码库中,Rust 将更易于维护,因为它的类型系统有助于强制执行不变量。因此,如果所有语言的成本大致相同,那么为什么不选择一种在安全性和性能上都有显著优势的语言呢?由于这些原因,Rust 正迅速成为现有代码库进行 AI 重构的首选语言。但对于 UI 层的策略,目前尚未达成共识。我预测,未来将会出现一小波尝试各种不同方案的热潮。

Native is complicated My 2022 blog post had a large section on “native,” first pointing out that the term has no clear meaning, and more broadly pointing out that “native” UI toolkits are simply choices among many, and should be evaluated on the important quality criteria. I think this is largely still true, but it depends greatly on which platform is being targeted. Windows still has no clear native choice (see Microsoft Hasn’t Had a Coherent GUI Strategy Since Petzold) and on Mac there is a bit of fragmentation between AppKit and SwiftUI.

原生很复杂。我在 2022 年的博文中用很大篇幅讨论了“原生”,首先指出这个术语没有明确的含义,更广泛地指出“原生”UI 工具包只是众多选择中的一种,应该根据重要的质量标准进行评估。我认为这在很大程度上仍然正确,但这在很大程度上取决于所针对的平台。Windows 仍然没有明确的原生选择(参见《自 Petzold 以来微软就没有连贯的 GUI 策略》),而在 Mac 上,AppKit 和 SwiftUI 之间存在一些碎片化。

However, SwiftUI has performance issues (see Michael Tsai blog from 2025) and so it is clearly possible to do better on the performance front. While desktop UI has remained stagnant, the situation on mobile is a bit different. Platforms continue to invest, and there are many fine details that are important for an app to look and feel native. One very notable example is Liquid Glass on iOS – if you use UIKit or SwiftUI, you can get that with little effort, but apps built with cross-platform toolkits won’t quite seem right.

然而,SwiftUI 存在性能问题(参见 2025 年 Michael Tsai 的博客),因此在性能方面显然可以做得更好。虽然桌面 UI 停滞不前,但移动端的情况略有不同。平台持续投入,许多细节对于应用程序看起来和感觉上像原生应用至关重要。一个非常显著的例子是 iOS 上的 Liquid Glass——如果你使用 UIKit 或 SwiftUI,你可以毫不费力地实现这一点,但使用跨平台工具包构建的应用程序看起来就不会那么地道。

In addition, making gesture recognition, scroll dynamics, and IME 100% match the platform are not yet fully solved problems. Thus, for mobile, an extremely viable path is to use the native toolkit for UI but do the common “business logic” in Rust. I’m not sure about the business logic, but for the UI, this is the decision that Shopify has made recently, abandoning React Native. I believe 1Password has this architecture. This is also the “Phoenix” plan for Discord on mobile, while using GPUI on desktop.

此外,使手势识别、滚动动态和输入法(IME)与平台 100% 匹配尚未完全解决。因此,对于移动端来说,一条极其可行的路径是使用原生工具包构建 UI,但用 Rust 处理通用的“业务逻辑”。我不确定业务逻辑方面的情况,但对于 UI,这是 Shopify 最近做出的决定,他们放弃了 React Native。我相信 1Password 也采用了这种架构。这也是 Discord 在移动端采用的“Phoenix”计划,而在桌面上则使用 GPUI。

That said, there’s been considerable progress in trying to build mobile UI entirely in Rust. Below is a short screencast of the editor demo in android-view. You can see that a lot of IME functionality works, including swiping, moving the cursor by rolling the space bar, and deleting in semantic chunks. Not shown in the video below, but composition regions (needed for CJK) also work, and there’s basic accessibility through AccessKit.

话虽如此,在尝试完全用 Rust 构建移动端 UI 方面已经取得了相当大的进展。下面是 android-view 中编辑器演示的短视频。你可以看到许多 IME 功能都能正常工作,包括滑动、通过滚动空格键移动光标以及按语义块删除。视频中未展示的是,组合区域(CJK 所需)也能正常工作,并且通过 AccessKit 提供了基本的辅助功能。

Text layout and accessibility infrastructure is basically solved One of the big unsolved problems as of the 2022 blog post was text layout. It is of course a hard problem to get right. I’m pleased to say that the ecosystem now has a good solution, in the form of Parley. It’s gotten there as a result of sustained investment from Google, Canva, and Dioxus (now Cognition), as well as contributions from the community. It seems to be used in the majority of new Rust UI toolkits.

文本布局和辅助功能基础设施已基本解决。截至 2022 年博文发布时,未解决的一大难题是文本布局。当然,要做好这个问题很难。我很高兴地说,生态系统现在有了很好的解决方案,即 Parley。这是 Google、Canva 和 Dioxus(现为 Cognition)持续投资以及社区贡献的结果。它似乎已被大多数新的 Rust UI 工具包所采用。

In addition, to help mitigate the risk of monoculture, Cosmic Text is a viable alternative. AccessKit was just getting started in 2022, but is now solid infrastructure as well, and used by most UI toolkits. I should note, though, there is a difference between a good integration and a box ticking exercise. And there is more work to be done, for example to make rich text editing fully accessible. One other problem I’d like to see addressed is performance degradation when accessibility is enabled. This is a problem for egui in particular, as it has to build and diff a tree each animation frame, undercutting the benefits of its underlying immediate mode design.

此外,为了帮助降低单一文化的风险,Cosmic Text 是一个可行的替代方案。AccessKit 在 2022 年才刚刚起步,但现在也已成为稳固的基础设施,并被大多数 UI 工具包所使用。不过我应该指出,良好的集成与仅仅为了完成任务而打勾是有区别的。还有更多工作要做,例如使富文本编辑完全具备辅助功能。我希望看到的另一个问题是启用辅助功能时的性能下降。这对 egui 来说尤其是一个问题,因为它必须在每一帧动画中构建和对比树结构,从而削弱了其底层即时模式设计的优势。

System compositor is still unsolved One topic I talked about extensively in the 2022 blog post is leveraging the system compositor. This issue is even more pressing today, especially with the increased importance of video. You really want a video playing in a hardware accelerated lay

系统合成器仍未解决。我在 2022 年的博文中广泛讨论的一个主题是利用系统合成器。这个问题在今天变得更加紧迫,尤其是随着视频重要性的增加。你确实希望视频在硬件加速层中播放。