Iced 0.14 has been released (Rust GUI library)
Posted by airstrike 4 days ago
Comments
Comment by lazypenguin 4 days ago
egui has served me well and is eagerly recommended in "what gui should I use" threads since it solves the widget problem well in an easy-to-use package. However, any sufficiently advanced application ends up needing a nice architecture to maintain development speed and enjoyment. I've found whether using egui/slint/fltk/etc. you end up having to roll your own system. When you start needing things like undo/redo you suspiciously start architecting something that smells like the elm architecture.
Iced is the only Rust toolkit that I track that solves the architecture part upfront. The message pattern is hugely powerful but it is hard to appreciate until you've really gotten in the weeds on larger applications. Once iced reaches a point where there is an advanced set of widgets available I suspect its popularity will rise accordingly.
As a comparison, one of the most successful desktop gui toolkit of all times (Qt Widgets) solved the architecture/widget duality long ago with the signal/slot system and advanced widgets like treeviews, datagrid, etc. Since then we must have had hundreds of "desktop" toolkits across all languages that can draw buttons and dropdowns but nobody has toppled the king yet for building advanced desktop GUIs (although there were a few close competitors in C# with WPF and Java with Swing they only solved the widget part in my opinion). I like to think iced can take this mantle one day, best of luck to them and congrats on the 0.14 release.
Comment by bikelang 4 days ago
Comment by Klonoar 3 days ago
They contribute back but it’s a notable distinction.
Comment by satvikpendem 4 days ago
Comment by chironjit 3 days ago
That said, for actually building most apps, what's more important is likely ease of learning and using the framework, platform/OS support, publishing support, etc, none of which Iced itself directly address.
Comment by 0manrho 3 days ago
Well Iced itself claims to be inspired by the Elm Arch, so that checks out (see the first line under the Overview section of the Readme https://github.com/iced-rs/iced )
Comment by nextaccountic 3 days ago
Comment by avtar 4 days ago
And TIL about AccessKit https://github.com/AccessKit/accesskit
Comment by dotancohen 4 days ago
Python has a VLC library that embeds VLC behind the scenes for audio playback, and Qt had facility to work with it. This is terrific as I need to support a wide variety of codecs (voice recordings) and I need to change playback speed during playback. Does Rust or Iced have such capability to embed VLC? Not the VLC UI elements, just to use VLC behind the scenes.
Comment by thorn132 4 days ago
There's also PyO3 for using Python libraries from Rust, if no bindings or substitutes are available.
Comment by dotancohen 4 days ago
Comment by wonklebonkle 4 days ago
One thing I love about Iced and miss in Qt is writing the software in a single language. Qt has chosen to introduce multiple languages into their framework which makes the entire codebase a huge learning curve. In Qt you write your display layer in QML then your UI logic in Javascript and any backend advanced logic in C++. It is frankly exhausting.
In Iced you write in Rust and use Cargo packages. This gives the developer ultimate composability and clarity of their application as well as powerful tools from an established ecosystem. If Qt wanted to provide a powerful Qml tool, they have to write it and build all of the IDE integration.
For the record Qt used to be moving in a pure C++ direction but that changed when Qml came onto the scene.
Comment by rubymamis 4 days ago
Comment by 0manrho 3 days ago
That said there's simplicity to Iced being pure rust managed through cargo that I enjoy. Though it should be said that my "learning curve" for Iced was much lower than it might be for others as I discovered it well after I'd adopted Elm (which inspired Iced) and - independently - Rust, so Iced was pretty easy for me to grok.
I don't think there's a right/wrong way there to be honest, both approaches have their pro's/con's, and my main issues with Iced vs Qt is largely a matter of maturity/prevalence than any specifics with the implementations/workflow themselves.
Comment by mroche 4 days ago
I've always been curious about productizing apps like these, from a financial/business perspective have you found Daino worthwhile or enough of a success (by your standards) to continue developing it as a proprietary application?
Comment by rubymamis 4 days ago
Not really, not yet. Once my FOSS app was popular I used to earn a livable amount of money from ads on the website. But after a SEO crash that all went down the drain and the money I'm getting now from subscriptions to Daino Notes is nice but not livable. I've been working the last year (at a really awesome place) doing React programming (my first salary job, actually) and at nights and weekends working on Daino.
I actually got many requests to license Daino Notes' block editor. So I've figured there's a business there. I'm working on something I'm calling Daino Qt which is a collection of different components to accelerate Qt apps development (so I'm also its client). It will include my block editor, components for mobile - current Qt components on mobile are extremly shitty - so I'm planning on changing that with things like native-feeling swipeable stack view, native-feeling text editing, etc. And maybe Qt C++ client SDK for InstantDB (and more stuff).
Hope I can sell this as well while also consuming these components for Daino Notes and other apps I will develop.
Comment by wonklebonkle 4 days ago
Comment by rubymamis 4 days ago
Comment by ktpsns 4 days ago
Biggest drawback in qt/c++ used to be the MOC. I guess they still have not gone rid of it, haven't they?
Comment by dotancohen 4 days ago
Comment by amelius 4 days ago
Comment by dotancohen 4 days ago
Comment by wonklebonkle 4 days ago
Comment by dotancohen 4 days ago
Comment by mootoday 4 days ago
Initially, I thought Tauri with Svelte. Then I learned about gpui (https://www.gpui.rs/) and I'm intrigued.
TIL about iced, which seems to have been around for a while.
Before I embark on building a prototype UI for my app with all three libraries, does anyone have hands-on experience they can share?
Comment by chironjit 4 days ago
1) Iced requires you to style everything in their own styling methods. It's not as intuitive as CSS. I found that, coming from using CSS, I struggled to recreate the style to the same high bar I expected from websites using css.
2)LLMs are not as familiar with Iced's styling, and will struggle with helping you plus also dealing with the breaking changes between Iced versions. Same to a lesser extent with Dioxus
3) Dioxus is easier to build by hand and via LLMs since you just use CSS/tailwind CSS. That said, even Dioxus is rough on the edges, you occassionly get some weird bugs, that you just have to deal with
4)PopOS' Iced version is great if you're using it on PopOS specifically but will require you to install a separate style pack on other linux distros to get the styling of the windows to show correctly. It's more mature than the original Iced IMO, though it's opinionated styling(of it's starter boilerplate) may be less to your liking. While I haven't used it in some time, I would consider it an almost independent fork by now
5) Last but most important negative IMO of Iced and Dioxus is their release cadence. Iced 0.14 has now launched more than a year since 0.13. For some the stability is great, but for frameworks that are still maturing with lots of improvements pending, I think it's actually important to have faster release cadences so that you know issues you face are not left hanging for a fix for a year.
Now onto more practical stuff: 1) If you need simple, standalone apps, any one will work. I think this may be true for your app idea
If you need speed of change, multi platform, etc, you will likely end up with Tauri. In that case, you might as well use the front-end framework you like.
2) None of the frameworks give you a pathway to publishing except Tauri. Basically, only Tauri really puts that as part of its guide, and so when you are going to Publish, you will be using Tauri's guide anyway
3) If you need multi-processing, Dioxus is out of your option, or you will end up using Tauri with Dioxus as your front-end
Comment by mootoday 4 days ago
Also, TIL about PopOS, thank you!
Comment by chironjit 3 days ago
Comment by airstrike 4 days ago
besides, new releases have nothing to do with fixing your specific issues.
and the pop os fork has historically rebased to the latest upstream release so not sure why you think it's independent
Comment by Klonoar 3 days ago
The master branch approach isn’t always ideal and people prefer having actual releases to base their work on. Not having a set release cadence and it more or less being on the whims of the one maintainer doesn’t exactly inspire the same level of trust you get from Dioxus/etc.
Comment by airstrike 3 days ago
You'll have to explain why the master branch approach isn't ideal. The only argument I've seen hold up is that the community can pin their own crates around a specific release, so if you rely on a lot of third party crates, you benefit from more frequent releases. Given iced is still pre-1.0, I do not encourage people to rely on a lot of third party crates. Most of them also have permissive MIT licenses so you can always bring any one-off bit of code into your own crate and maintain attribution. I did that with the split widget from iced_aw, which was available in 0.12 and dropped by those maintainers when 0.13 came around. I've since made several tweaks to it to fit my specific use cases, so all in all I'm just better off vendoring it myself.
In fact, you also have no guarantee that third-party crates will (1) continue to update for future releases and (2) evolve their own APIs in the manner that you prefer. So if you're worried about being up-to-date and/or stability, again bringing the code into your crates is again the better choice—at the obvious cost of having to maintain it yourself, but such is the nature of software.
I do not know what you mean by "inspire the same level of trust". Or I think I do, but I do not think it's helpful language or an accurate framing. Are you a part of the iced community? I can't speak for everyone, but ISTM that most everyone trusts hecrj implicitly—and we all understand iced is a labor of love, not commercial and the fact that it is subject to his whims actually helps guide a specific vision forward, however long that may take. The ride has been great so far. The Pop!_OS team seems to agree.
Finally, about Dioxus specifically, I'll leave this informative video here https://www.youtube.com/watch?v=dKvFFf04clU
Comment by chironjit 3 days ago
The choice of framework should not be dependent on who else is building on that framework. Ideally the factors that matter: 1) Why are you building a GUI app on rust? 2) Target platform/OS support? 3) Are you ok with custom styling methods? Would you prefer to use CSS? 4) Need for multi threading? 5) Publishing / bundling / signing app
I think the reason Dioxus cadence release is slow is that they realised so many things are missing with the rust gui ecosystem that they decided they needed to fix these while building the main product. Guess what, this basically slows down your main product cadence. Does rust need a sub second hot reloader? Yes. Does rust need a native html/CSS renderer? Also probably yes. Did the Dioxus team have to take it on given their size and all the things pending in building rust with html + css? Armchair observer me thinks not.
*Note that I am currently building an app with Dioxus, so I'm putting out my honest opinion, and not saying that you shouldn't use it.*
Comment by chironjit 3 days ago
I think this is me. My view is basically like this - if you use a tech you know works, you're only wrangling with your bugs. If you use a tech that is still being worked on, you are wrangling your bugs and the bugs of the tech you're using.
To be fair, I've tried this master branch thing with both Iced and PopOS's Iced fork. One year ago, PopOs's Iced fork was so slow I realised it basically wasn't going to be production ready for non Pop distros anytime soon.
IMO, both suffer from having very slow release cadence but at least dioxus has CSS
Comment by airstrike 3 days ago
Comment by chironjit 3 days ago
Of course, if I am being honest, the real reason is that there is so much CSS code out there, I can really find anything I need. And so can the LLMs.
Comment by airstrike 3 days ago
Comment by chironjit 3 days ago
Comment by jenadine 4 days ago
Comment by airstrike 4 days ago
I'm 90kloc in and couldn't be happier
I encourage you to join the Discord and look around
Comment by k_bx 4 days ago
Comment by sho_hn 4 days ago
Comment by nicoburns 4 days ago
Comment by tomnipotent 4 days ago
Comment by tuananh 4 days ago
Comment by tomnipotent 4 days ago
Comment by airstrike 4 days ago
They also contribute to iced indirectly via cosmic-text and other crates.
Comment by andsoitis 4 days ago
Comment by stackghost 4 days ago
Comment by clumsysmurf 4 days ago
Comment by globalnode 4 days ago
Comment by eviks 4 days ago
Comment by przmk 4 days ago
Comment by eviks 3 days ago
Or high memory use, another fatal flaw of all those electron apps https://github.com/iced-rs/iced/issues/820
Or window can't be centered (while this is basic, it's in a bit of a blame-the-broken-Wayland niche https://github.com/iced-rs/iced/issues/1287)
Or lack of accessibility https://github.com/iced-rs/iced/issues/552
Or poor keybinding support (though in the case of iced I see it's somewhat improved in this release with some IME support and non-latin https://github.com/iced-rs/iced/pull/3134, so don't know exactly what's left broken)
The there are non-runtime issues like lack of documentation
Comment by thorn132 3 days ago
The 'lack' of documentation was only a problem for me when I was doing a cursory comparison of UI frameworks. Once I seriously started learning iced, the resources available, including the community on discord, was plenty to start being productive on making real apps within a week or two (and I had very limited Rust experience before that).
Comment by eviks 3 days ago
Runtime speed is something different, even Electron is not that bad since the UIs are mostly too primitive to cause much of a visible slowdown, here the styling/animation capabilities are usually more prominent.
> including the community on discord
that's not a good baseline to cover the basics due to variable latency and predictability.
Comment by thorn132 3 days ago
> that's not a good baseline to cover the basics
I wasn't suggesting that everyone should join the discord and ask how to write 'Hello World'. There's an official (but WIP) book, unofficial guides, and many examples spanning basic to advanced usage for reference. An active discord is complementary to those. Having more learning resources is important for wide adoption, but that's not the priority in pre-1.0 development.
> startup much faster than the Qt(Pyside) and Electron apps they replaced, and run faster too
I forgot to mention, the iced apps have taken less time to develop more features with fewer bugs (and no segfaults).
Comment by eviks 2 days ago
Comment by thorn132 2 days ago
Comment by airstrike 2 days ago
Doesn't take 2 secs to load here, so maybe switch to a better OS
Comment by airstrike 3 days ago
I encourage you to try and do better next time.
Comment by eviks 3 days ago
I encourage you to read better next time and not close your eyes so tight as to miss the feedback.
Comment by andsoitis 4 days ago
State — the state of your application
Messages — user interactions or meaningful events that you care about
View logic — a way to display your state as widgets that may produce messages on user interaction
Update logic — a way to react to messages and update your state