Live data from Hacker News

Show HN: Rust GUI Library via Flutter

cjycode.com

11–20 of 108 posts

Re: Show HN: Rust GUI Library via Flutter

#11
post #5

I have been using this to build an app[0] for the last couple of years and I want to say that it has been a pleasure to use, there are some wrinkles but overall I have been very happy with the experience. 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…

You are welcome, and happy to hear it works for you!

Re: Show HN: Rust GUI Library via Flutter

#12
post #6

While I don't see the advantage of writing UI in Rust vs Dart, I'm a huge fan of flutter_rust_bridge. 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 librar…

You are welcome, and I am happy to see it helps! When I initially develop flutter_rust_bridge, my personal usage scenario is quite similar to yours: using Rust for some high performance algorithms.

Re: Show HN: Rust GUI Library via Flutter

#13

Interesting! IIUC this is done using source-to-source translation? It is a bit hard to understand from the docs what technical approach is. The docs are clearly aimed at users and I find them impressive, well done. I'd be interested in knowing the approach and how it compares to wasm based Rust web frameworks before diving more deeply into it. One advantage of combining Rust with Flutter seems to be that Flutter is a…

Thanks! Shortly speaking, the Rust code is parsed (e.g. "here is a function and there is a struct"), and then some Rust and Flutter code are generated. As for comparison, some pros and cons are discussed in the blog.

Re: Show HN: Rust GUI Library via Flutter

#15
post #7

Well done! I've heard only good things about rust_flutter_bridge. Some questions though (more like flutter question), how bloated flutter is (i.e. final app size) compared to mobile native (Java, Swift?) for simple app? And how's the UI performance looks like?

For app size, it depends on your specific scenario, because e.g. Flutter automatically removes library code that is not used. I remembered (but the memory is blur) simple app has something like ~5MB. Btw remember to split .so file per abi. For UI performance, I personally find it quite good, and Flutter(Dart) is compiled to assembly code via AOT (instead of e.g. JIT or interpreted), which theoretically speaking is also fast. For both, I would suggest to make a demo for your specific case to have more accurate results. Also I guess ask/discuss on the Flutter community may help.

Re: Show HN: Rust GUI Library via Flutter

#17

Isn't Flutter basically a way to use the C++ render engine from Chrome, with a "scripting" language most similar to Kotlin and Swift? Why not just use the Chrome render engine directly from Rust? Why all the extra steps?

There's too much infrastructure on top of the render engine to replicate. Flutter is backed by Google and has a fairly large ecosystem of community packages.

See Freya - which uses Skia - the render engine Flutter used until a while back.

Re: Show HN: Rust GUI Library via Flutter

#18
post #16

How does this compare to rinf?

The first image at the bottom of that post may be related to your question: https://www.reddit.com/r/rust/comments/191b2to/rinf_copies_a... Btw, why is your name green?

Green usernames mean they're a new account! Here's a quote from the official FAQs:

> What do green usernames mean? > Green indicates a new account.

https://news.ycombinator.com/newsfaq.html

Re: Show HN: Rust GUI Library via Flutter

#19

Commendable effort! I’m currently using Tauri for a project myself and was wondering if anyone has any pros/cons between the two?

Thank you! I heard some people saying that, for apps using JavaScript, Tauri is replacing Electron and is popular nowadays, since Electron is very widely used. It seems Tauri cannot let Rust communicate with JavaScript very seamlessly yet, e.g. https://tauri.app/v1/guides/features/command/ seems to have mainly basic features. oneshtein mentioned below that Tauri does not support mobile as first class citizen yet as well. Looking forward to seeing Tauri's bridge to improve and supporting mobile better in the future!

Re: Show HN: Rust GUI Library via Flutter

#20
post #4

Earlier quoted context omitted.

And then there's also crux [1], which is the same "write your mobile app business logic once in Rust", but instead of Flutter, integrates directly with native iOS/Android/Web UIs [1] https://redbadger.github.io/crux/

Tauri supports mobile platforms too. Sadly, it's not a first class citizen in Tauri 2.0 as promised. I tried both Flutter and Tauri. IMHO: Tauri is better, because it allows me to use existing web frameworks (or even plain Markdown + Pandoc!), to make web-pages, while handling business logic in type safe Rust.

Isn't Dart type safe?
Post reply on HN