Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Advice for the next 100 Rust GUIs

This article serves as a follow-up to a previous piece on advice for the next dozen Rust GUI applications, published four and a half years ago. Since then, the landscape has evolved considerably, with approximately two dozen Rust GUI toolkits announced and a surge in interest driven by the growing relevance of AI in software development.

The desire to construct graphical user interface applications in Rust persists, despite many shipping GUI applications still experiencing performance issues, particularly when utilizing cross-platform technology. Established GUI toolkits provided by platforms have largely remained stagnant, and system vendors have shown little interest in addressing the cross-platform challenge, leading to the rise in popularity of Electron.

With memory becoming more costly and a shift towards mobile devices, the consequences of bloated applications have become significant. Building high-performance UI in Rust is increasingly seen as a pragmatic solution to these challenges. However, the adoption of Rust UI has been slower than anticipated. Only a handful of flagship applications have embraced Rust for their user interface, with the Zed editor standing out as a notable example.

Built upon GPUI, a framework developed by the creators of Zed, it demonstrates that delivering Rust UI is not only feasible but also feasible in real-world scenarios. GPUI is emerging as a strong contender for AI-driven code rewrites, as evidenced by its use in Discord. The slow adoption of Rust UI may be attributed to several factors.

Firstly, writing Rust code demands a higher level of expertise compared to languages more commonly used for UI development like TypeScript, Kotlin, or Swift. Additionally, finding developers proficient in both Rust and UI design remains a challenge. Nevertheless, advances in artificial intelligence are beginning to mitigate these obstacles.

The cost of generating code using Large Language Models (LLMs) appears to be comparable across different programming languages, and there is reason to believe that Rust's robust type system can enhance maintainability in large codebases. Consequently, Rust is gaining traction as the preferred language for AI rewrites of existing codebases.

Despite this, there is still no unanimous agreement on the strategy for the UI layer. Drawing from my 2022 blog post, I predict a surge in experimentation with various approaches. My initial advice emphasized that the term "native" lacks a clear definition, and "native" toolkits should be assessed based on essential quality criteria.

While Windows still lacks a clear native option and Mac experiences some fragmentation between AppKit and SwiftUI, SwiftUI's performance issues suggest that there is ample room for improvement in this area. The mobile landscape presents a different scenario. While platforms continue to invest resources into refining their native toolkits, achieving a truly native feel for apps built with cross-platform frameworks remains elusive.

Nevertheless, utilizing the native toolkit for UI while handling common "business logic" in Rust is gaining traction. Shopify and 1Password are two notable examples that have adopted this approach, abandoning React Native in favor of this strategy. For mobile applications, leveraging the native toolkit for UI seems to be the most viable option.

However, substantial progress has also been made in developing mobile UI entirely in Rust. The Android View editor demo provides a glimpse of this progress, showcasing features such as IME functionality, swiping, cursor movement, semantic text deletion, composition regions (essential for CJK text), and basic accessibility through AccessKit.

One particularly notable development is the emergence of Parley, a comprehensive text layout solution that has gained widespread adoption among new Rust UI toolkits, thanks to sustained investment from Google, Canva, and Dioxus (now Cognition), as well as contributions from the community. Another viable alternative is Cosmic Text.

Both solutions address the critical issue of text layout, which had long been a significant challenge in Rust UI development. Furthermore, AccessKit has evolved into a robust infrastructure, now integrated into most Rust UI frameworks. Accessibility remains an area that requires further attention, particularly in ensuring seamless integration with rich text editing.

Lastly, performance degradation when accessibility features are enabled is an issue that needs to be addressed, especially in frameworks like egui, which rely on an immediate mode design and must rebuild and diff a tree on each animation frame. An intriguing topic that was extensively discussed in my 2022 blog post is the utilization of the system compositor.

This issue has become even more pressing in the current context, particularly with the increased importance of video content and the demand for smooth frame rates, even on low-end devices. While progress has been made in this regard, exemplified by the subduction library, it is not yet widely integrated into UI toolkits.

Rewritten by urgent.news; may contain errors — check the original.

Read the original at linebender.org →

Report a problem with this story

More in Tech

Private Browser File Uploads: Object Storage Service and 3-Stage Throughput

Short answer: for a marketplace accepting private browser uploads, the least complex design is a direct-to-object-storage upload followed by backend processing and an expiring download URL.

  • Private browser uploads use object storage service for direct upload
  • Three file sizes tested: 25 MB, 250 MB, 2 GB with 1, 10, 50 concurrent uploads
  • S3 recommended for ecosystem, but R2, GCS, Infrai viable alternatives

Next.js Hosting for Headless CMS

If you want to use Next.js as the frontend for a headless CMS, this covers where to host it and what each option costs you in money and DevOps effort.

  • Next.js can run on any environment with Node.js support.
  • Managed and edge platforms like Vercel handle VM patching and CDN routing.
  • Cloudflare Workers offer global edge scale without VM management.

Headless CMS Frontend Frameworks

If you want to pick a frontend framework for a headless CMS website, this covers the SPA and MPA options I'd consider and when each one fits.

  • SPA frameworks hydrate pages with JavaScript, leading to higher INP and memory leaks
  • MPA architectures serve static HTML, providing better Core Web Vitals and analytics performance
  • SPA and MPA each have distinct strengths and weaknesses for headless CMS frontends

German e-invoicing for developers: XRechnung and ZUGFeRD via REST API and MCP

From 2027, many German businesses have to send structured e-invoices to other businesses, and from 2028 almost all of them. Receiving them has been mandatory since 1 January 2025.

  • German businesses must send e-invoices by 2028, starting 2027 for high-revenue firms
  • XRechnung is pure XML (UBL or CII syntax) format
  • ZUGFeRD combines PDF/A-3 with embedded XML

More from Saturday 21 November →