HeadlinesBriefing HeadlinesBriefing.com

GPUI and egui: Why Their State Models May Not Scale

Hacker News •
×

A growing number of desktop GUI apps are being built with Rust-native frameworks like GPUI and egui, including Discord’s upcoming rewrite. However, the author argues that both frameworks use state models that are dead ends for complex applications. While they offer simplicity and speed in small cases, they fail to scale because they lack precision in tracking state changes.

Every UI framework must eventually answer: when state changes, what runs? GPUI relies on manual `notify()` calls that re-render entire views unless explicitly cached, similar to Angular’s deprecated zone.js. egui re-runs all UI code each frame. The author, who ported GPUI’s renderer and works on zgui, advocates for signal-based systems where only dependent components update. These reactive models, used in Solid, Floem, and Freya, offer better performance and scalability by automatically tracking dependencies.

While immediate-mode frameworks are easier to write, they shift the burden of optimization to the developer. For large apps, the author believes signal-based architectures are the only sustainable path forward.

Source: Hacker News · Summarized by HeadlinesBriefing