I want use rust to be backend for a GUI project.I am using frb which combines Flutter and Rust,but it hard to interact with some complicate type or some type that cannot be send from one to another.So I hope to find a Rust GUI framwork which has enough power to build product level applications.
Don't think there are any 'frameworks' as yet but lots of libraries to choose from. It depends on needed specifications and taste, I suppose.
I am in the process of creating some wasm frontends with egui, since I dislike css & html (like) code. So far it does what I want although it does have its challenges. Other options are: Iced, Slint, Dioxus, Yew.
which do you think is the most stable one ( have a stable api ) and production ready ? out of iced,slint ,dioxus they all look very interesting.
Probably less mature, but interesting would be gpui, the framework used by Zed
I personally have really grown to like wxDragon (crates.io: Rust Package Registry). You get completely native controls on all platforms! This means automatic screen reader accessibility, a more native look and feel across platforms, etc.
Alright, did you try looking into FFI options, like a Flutter bridge using DTOs and async calls, or are you only interested in building a GUI directly in Rust?
This sounds more like you have too much going on in your models, e.g. mixed up view state with your data model. But, it's hard to tell without seeing any code. Be aware, that this will give you more or less trouble in any UI lib.
Personally, I'm using iced and I like it very much, mainly because there is no magic (it's not a framework at all), just plain Rust code. But, that comes at the price, that you have all the plumbing to do by yourself.
Requisite https://areweguiyet.com/ and check out some of the referenced similar topics below.
A quick recap from the last I checked:
Really the only thing I'd call "product ready" was Tauri, which is "cheating" by just giving you a web view you can do whatever in.
Iced is the most complete pure Rust library, but although the COSMIC desktop environment recently released based on it, it seems they effectively forked instead of getting all their specific tweaks upstreamed. I'm not sure if there's a full product using Iced, but definitely check it out.
There's a couple of very cool looking, but commercial libraries, Slint and Makepad. I haven't used them though, so I don't know how much it holds up outside demos.
There's definitely a bunch of new ones since I last went through them though, give the whole list a look.
I have tried to use FFI,but some type like database connection or tcp connection cannot be transfer and needless.It's hard to reuse these type and I don't know figure it out in an easy way.So I am more interested in building GUI in Rust.
You have two choices here: either engine backed frameworks like Tauri.rs, which run almost everywhere with minimal complexity but aren’t fully native and sacrifice some performance, or platform-backed frameworks like Iced, which give a native look and feel but require more per-platform work.
I found this article summaries the GUI ecosystem pretty good.
My favorite right now is gpui with GitHub - longbridge/gpui-component: Rust GUI components for building fantastic cross-platform desktop application by using GPUI.. The documentation is not great but I really like the results.
There are some nice projects out there, for example Halloy and generic_daw.
You can find many more projects on the iced Discord server. If anyone tries iced, make sure to join the Discord, very helpful people out there.
but it's so hard to use.and gpui is in a vary early stage
Definitely production ready are:
Slint - GPLv3, commerical license is also free as long as you don’t work on embedded systems
Tauri - Web-UI ala Electron, but better;)
What you could also try is:
Makepad - quite new but it looks very complete and there is a company behind it
egui - Immediate mode, very powerful, used by Rerun.io
Has anyone tried Xilem?
It looks very promising but I wonder if we can already build a reasonably complex application with it now (for example several windows with tabs, modals for simple confirmation or file choosing, and with mostly standard widgets + 2d interactive plots).
I want to vouch for Tauri.app. Especially if you're familiar with web-technologies like HTML, CSS and Javascript you'll get the hang of it quickly.
Tauri is definitely production-ready, has good documentation and a big community. I personally did not stumble upon any impediment handling complex types or complicated logic.
You can see some screenshots of a hobby-project (chat application) made in Tauri here.
I use GPUI. It's native, GPU rendered, and easy to use API because the API is like CSS and I already know CSS. I like display flex very muchhh
It's immediate mode
Yes, I made the chess and sudoku GUI with it:
Raph Levien is a really smart and productive person, and Google funded 4 other Xilem devs in early 2024. But still the development was not too fast, and I am not sure if Google funding is still active. I have not yet managed to understand the internals of Xilem -- there is not much documentation available. I think the design is good, the few existing widgets are easy to use, and its GPU rendering with Vello is state of the art. It uses retained mode with its own widgets. But it is still called alpha and experimental.