
Executive Brief
A software developer published a detailed technical writeup on June 22, 2025, documenting their experience migrating a cross-platform application from Flutter to pure Rust using the egui immediate mode GUI library. The blog post, hosted at jdiaz97.github.io, provides a comparative analysis of both approaches and explains the technical reasoning behind the transition.
The migration addresses a common pain point in cross-platform development: the complexity of maintaining foreign function interface (FFI) bridges between different language runtimes. Flutter applications that require native Rust code for performance-critical operations typically use the flutter_rust_bridge library, which generates binding code between Dart and Rust. The developer found this approach introduced significant maintenance overhead.
Egui, an immediate mode GUI library written in Rust, offers an alternative architecture where the entire application stack uses a single language. The library has accumulated 24,000 stars on GitHub as of June 2025, indicating substantial community adoption. Unlike retained mode frameworks like Flutter, egui redraws the entire interface each frame, simplifying state management at the cost of some rendering efficiency.
The Hacker News discussion attracted significant engagement, with developers debating the tradeoffs between immediate and retained mode GUI paradigms. Participants noted that egui's approach suits certain application types better than others, particularly tools and utilities where complex widget hierarchies are less common.
The writeup provides concrete code examples comparing equivalent functionality in both frameworks, offering practical guidance for developers considering similar migrations.
What Happened
The developer began their project using Flutter with Rust backend code connected via flutter_rust_bridge. According to the blog post, this architecture initially seemed appropriate for a cross-platform application requiring both native performance and rich UI capabilities.
Over time, the flutter_rust_bridge integration introduced friction. The library generates Dart bindings from Rust code, but changes to Rust function signatures required regenerating bindings and updating Dart call sites. The developer reported that this two-language workflow slowed iteration speed and complicated debugging.
The migration to pure Rust with egui eliminated the FFI boundary entirely. The blog post describes a phased approach: first porting core logic (already in Rust), then rebuilding the UI layer using egui's immediate mode paradigm.
Egui's architecture differs fundamentally from Flutter's widget tree model. In Flutter, developers declare a hierarchy of stateful widgets that the framework manages and updates incrementally. In egui, developers write code that draws the entire UI each frame, with the library handling input events and rendering.
The Hacker News discussion on June 22, 2025, surfaced additional perspectives from developers who had attempted similar migrations. Some reported success with egui for developer tools and utilities, while others noted challenges with complex layouts or accessibility requirements.

Key Claims and Evidence
The blog post makes several technical claims supported by code examples and repository references:
Reduced code complexity: The developer reports that removing flutter_rust_bridge eliminated approximately 30% of their codebase, primarily generated binding code and Dart wrapper functions.
Faster iteration cycles: Without FFI regeneration steps, the developer claims build times decreased and the edit-compile-test loop became more responsive.
Single-language debugging: Debugging sessions no longer require context-switching between Dart and Rust toolchains. Stack traces and breakpoints work consistently across the entire application.
Egui maturity: The egui repository shows 24,000 GitHub stars and active development. The library supports multiple rendering backends including wgpu, glow, and native platform integrations.
Flutter_rust_bridge complexity: The flutter_rust_bridge repository documents extensive configuration requirements and code generation workflows. The library addresses a genuine need but introduces architectural complexity.
Pros and Opportunities
Language unification: Developers working in a single language avoid cognitive overhead from context-switching. Rust's ownership model and type system apply consistently throughout the application.
Simplified deployment: Pure Rust applications compile to native binaries without requiring Dart runtime or Flutter engine dependencies. Binary sizes may decrease depending on the application.
Rust ecosystem access: Direct access to Rust crates without FFI wrappers enables cleaner integration with libraries for networking, cryptography, data processing, and other domains where Rust excels.
Immediate mode simplicity: Egui's architecture eliminates widget lifecycle management. Developers describe what to draw each frame rather than managing stateful widget trees.
Cross-platform support: Egui supports Windows, macOS, Linux, and web (via WebAssembly) from a single codebase, similar to Flutter's cross-platform promise.

Cons, Risks, and Limitations
Ecosystem maturity: Flutter's widget library and package ecosystem far exceed egui's. Complex UI patterns may require custom implementation in egui.
Accessibility gaps: Flutter includes built-in accessibility support for screen readers and assistive technologies. Egui's accessibility story remains less developed, according to the repository documentation.
Rendering efficiency: Immediate mode GUIs redraw every frame, consuming more CPU/GPU resources than retained mode frameworks that update incrementally. For complex interfaces, this may impact battery life on mobile devices.
Learning curve: Developers familiar with retained mode frameworks must adapt to immediate mode thinking. The paradigm shift requires unlearning certain patterns.
Mobile platform support: While egui supports mobile platforms, Flutter's mobile integration is more mature with better platform-specific UI conventions and native feel.
Community size: Flutter's larger community means more tutorials, Stack Overflow answers, and third-party packages. Egui developers may encounter less readily available help.
How the Technology Works
Immediate mode GUI differs fundamentally from retained mode frameworks:
Retained mode (Flutter): The application builds a tree of widget objects. The framework tracks widget state and updates only changed portions of the tree. Widgets have lifecycles with initialization, update, and disposal phases.
Immediate mode (egui): The application calls drawing functions each frame. There is no persistent widget tree. The library provides functions like ui.button("Click me") that both draw the button and return whether it was clicked.
Egui's frame loop operates as follows:
- The application receives input events (mouse, keyboard, touch)
- Egui processes events and updates internal state
- The application calls UI code that describes the current frame
- Egui generates draw commands (vertices, textures)
- A rendering backend (wgpu, glow, etc.) executes draw commands
State management in egui uses Rust's standard patterns. Developers store application state in structs and pass mutable references to UI code. The UI code reads state to determine what to draw and modifies state based on user interactions.
Technical context (optional): Immediate mode GUIs originated in game development, where redrawing each frame is standard practice. The approach trades rendering efficiency for programming simplicity. Modern GPUs handle the additional draw calls efficiently for most applications, though complex interfaces with thousands of elements may see performance impacts.
Broader Implications
The migration writeup reflects broader tensions in cross-platform development tooling.
Flutter's approach of using Dart with optional native code via FFI represents one architectural philosophy: use a high-level language for UI with escape hatches to native code when needed. This works well when native code requirements are limited.
Pure Rust approaches like egui represent an alternative: use a systems language throughout, accepting different tradeoffs. This suits applications where performance-critical code dominates or where FFI complexity outweighs Dart's productivity benefits.
The Rust GUI ecosystem continues maturing. Beyond egui, projects like Iced, Druid (now Xilem), and Slint offer different approaches to Rust-native UI development. None yet match Flutter's ecosystem breadth, but the gap narrows as these projects mature.
For developer tools, utilities, and applications where native performance matters throughout the stack, pure Rust approaches become increasingly viable. For consumer applications requiring polished platform-native UI conventions, Flutter and similar frameworks retain advantages.
What's Confirmed vs. What Remains Unclear
Confirmed:
- The blog post exists and documents a real migration experience
- Egui is an active project with 24,000 GitHub stars
- Flutter_rust_bridge introduces code generation complexity
- Immediate mode and retained mode represent fundamentally different GUI paradigms
- The Hacker News discussion generated community engagement
Unclear:
- Whether the performance characteristics described generalize to other applications
- Long-term maintenance burden comparison between approaches
- How egui's accessibility support compares in practice
- Whether the developer's specific use case is representative of broader patterns
- Quantitative metrics on build time improvements
What to Watch Next
Developers interested in Rust GUI development should monitor several indicators:
- Egui release notes and roadmap for accessibility improvements
- Flutter_rust_bridge evolution and whether complexity decreases
- Adoption patterns in the Rust community for different GUI frameworks
- Performance benchmarks comparing immediate and retained mode approaches
- Mobile platform support maturation in Rust GUI libraries
- Enterprise adoption signals for pure Rust desktop applications
Sources
- jdiaz97 Blog - Flutter to Rust Migration - https://jdiaz97.github.io/blog/flutter-to-rust/
- emilk/egui GitHub Repository - https://github.com/emilk/egui
- fzyzcjy/flutter_rust_bridge GitHub Repository - https://github.com/fzyzcjy/flutter_rust_bridge
- Hacker News Discussion (June 2025) - https://news.ycombinator.com/item?id=44345678

