TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Rust GUI Library via Flutter

301 点作者 fzyzcjy10 个月前
Hi, I made a bridge (<a href="https:&#x2F;&#x2F;github.com&#x2F;fzyzcjy&#x2F;flutter_rust_bridge">https:&#x2F;&#x2F;github.com&#x2F;fzyzcjy&#x2F;flutter_rust_bridge</a> v2.0.0) between Flutter and Rust, which auto translates syntaxes like arbitrary types, &amp;mut, async, traits, results, closure (callback), lifetimes, etc. The goal is to make a bridge between the two, seamlessly as if working in one single language.<p>Then, as an example, I showed how to write Rust applications with GUI by utilizing Flutter. That is discussed in the link in details.<p>To play with it, please visit the GitHub repo, or refer to the end of the article for detailed folders and commands.<p>When I first released 1.0.0 years ago, it only contained few features compared to today. It is the result of the hard work of contributors and me, and many thanks to all the contributors!

16 条评论

tmpfs10 个月前
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.<p>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.<p>Writing all the app business logic in Rust and using Dart as the front-end works out really well. I know Flutter&#x2F;Dart doesn&#x27;t get much love here on HN but in my opinion I think it&#x27;s much easier to reason about than a system like React which I think is the wrong level of abstraction compared to Flutter&#x27;s render the entire widget tree approach.<p>Massive thanks to @fzyzcjy for all the work on FRB, great job!<p>[0]: <a href="https:&#x2F;&#x2F;saveoursecrets.com" rel="nofollow">https:&#x2F;&#x2F;saveoursecrets.com</a>
评论 #41216469 未加载
评论 #41214593 未加载
评论 #41214925 未加载
评论 #41214322 未加载
评论 #41215630 未加载
评论 #41217135 未加载
评论 #41219219 未加载
blopker10 个月前
While I don&#x27;t see the advantage of writing UI in Rust vs Dart, I&#x27;m a huge fan of flutter_rust_bridge.<p>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&#x27;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.<p>The app ended up being more capable and faster than ImageOptim, largely just because of the Rust integration. Thank you fzyzcjy!<p>[0]: <a href="https:&#x2F;&#x2F;github.com&#x2F;blopker&#x2F;alic&#x2F;blob&#x2F;main&#x2F;rust&#x2F;src&#x2F;api&#x2F;compressor.rs">https:&#x2F;&#x2F;github.com&#x2F;blopker&#x2F;alic&#x2F;blob&#x2F;main&#x2F;rust&#x2F;src&#x2F;api&#x2F;compr...</a>
评论 #41214328 未加载
评论 #41214035 未加载
bubblebeard10 个月前
Commendable effort! I’m currently using Tauri for a project myself and was wondering if anyone has any pros&#x2F;cons between the two?
评论 #41214452 未加载
评论 #41216588 未加载
burakemir10 个月前
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&#x27;d be interested in knowing the approach and how it compares to wasm based Rust web frameworks before diving more deeply into it.<p>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.<p>A comparison with other ways Rust
评论 #41214330 未加载
sbt56710 个月前
Well done! I&#x27;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&#x27;s the UI performance looks like?
评论 #41214366 未加载
BodyCulture10 个月前
How is the a11y story with this? I did not find any info about it in the document, but I can not imagine anyone releasing a GUI kit in 2024 without extensive a11y support, so why not mention it?
评论 #41216168 未加载
nu11ptr10 个月前
I use Flutter for my desktop UI and Rust for my backend. However, I chose to separate the two using gRPC instead of the bridge. This allows me to be agnostic of language on both sides and I suspect gives me a cleaner interface for mocking the backend from my frontend. It also makes it easy to place the UI and backend on different machines giving a true client&#x2F;server architecture. The con is likely that the interface is probably more verbose, however.
评论 #41215798 未加载
pjmlp10 个月前
Much better than reaching out to Chrome shells or Web widgets, kudos for the effort.
评论 #41214520 未加载
danielvaughn10 个月前
Nice, I really enjoyed Flutter&#x27;s approach to building UI, but I didn&#x27;t really care for Dart all that much.<p>In theory shouldn&#x27;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&#x27;s declaring user interfaces. Is that a crazy or stupid idea?<p>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).
评论 #41218331 未加载
评论 #41218936 未加载
评论 #41217087 未加载
评论 #41217259 未加载
sydbarrett7410 个月前
Does anyone know if Google plans to sunset the entire Flutter framework over time? Since they fired just about everybody internal who was working on it, I don&#x27;t have a lot of confidence that Flutter will still have any Google support in 3-5 years. Has anyone talked about forking it and putting it under an independent foundation to ensure its long-term viability? Given Google&#x27;s track record of long-term support for its various technologies, it would be a shame if Flutter got consigned to history&#x27;s scrap-heap prematurely.
评论 #41226389 未加载
评论 #41222434 未加载
polyaniline10 个月前
How does this compare to rinf?
评论 #41214388 未加载
评论 #41213947 未加载
评论 #41226476 未加载
j-krieger10 个月前
Flutter Rust Bridge is without a doubt the best FFI bridge I‘ve ever used. It works like magic. I have no idea how it‘s done.
评论 #41216128 未加载
the__alchemist10 个月前
Does anyone know how this compares to EGUI in terms of performance, binary size, flexibility, and overall experience?
api10 个月前
The sample with Google&#x27;s IMHO ugly material design plus confetti is not the best look.
webprofusion10 个月前
Cool, but the point of having stuff in Rust is to ideally have everything in Rust, or you&#x27;re by definition not getting all the safety benefits of Rust.
评论 #41215109 未加载
评论 #41216373 未加载
评论 #41215155 未加载
jurschreuder10 个月前
Isn&#x27;t Flutter basically a way to use the C++ render engine from Chrome, with a &quot;scripting&quot; language most similar to Kotlin and Swift?<p>Why not just use the Chrome render engine directly from Rust?<p>Why all the extra steps?
评论 #41214883 未加载
评论 #41214502 未加载
评论 #41214415 未加载