The work fzyzcjy and the community have put into calling Rust code from Dart seamlessly is such an asset to Flutter apps. I remade the popular image compression app ImageOptim in Flutter over a weekend because webp wasn't supported. After a little pain in the initial setup, I was able to call mature Rust image libraries using flutter_rust_bridge and a small wrapper[0]. It even handled all the parallelism for me.
The app ended up being more capable and faster than ImageOptim, largely just because of the Rust integration. Thank you fzyzcjy!
[0]: https://github.com/blopker/alic/blob/main/rust/src/api/compr...
One advantage of combining Rust with Flutter seems to be that Flutter is a whole framework already and one would be able to share code and data structures between server and client side.
A comparison with other ways Rust
In theory shouldn't it be possible to create a programming language specifically for UI? Something that can be interfaced with from any major programming language. Kinda like protobuf with its IDL format, but instead of defining data, it's declaring user interfaces. Is that a crazy or stupid idea?
QT and XAML come to mind, but I believe QT is closed source (might be wrong about that), and XAML seems to have been dead in the water for a long time now (also might be wrong about that).
Why not just use the Chrome render engine directly from Rust?
Why all the extra steps?
Upgrading from v1 to v2 was not too difficult and v2 is a significant upgrade with lots of useful features, massively improved codegen experience and support for tokio async were the big gamechangers for me.
Writing all the app business logic in Rust and using Dart as the front-end works out really well. I know Flutter/Dart doesn't get much love here on HN but in my opinion I think it's much easier to reason about than a system like React which I think is the wrong level of abstraction compared to Flutter's render the entire widget tree approach.
Massive thanks to @fzyzcjy for all the work on FRB, great job!
[0]: https://saveoursecrets.com