Hacker News new | ask | show | jobs
by account-5 1346 days ago
This might have an obvious answer for the more experienced here, but (potentially stupid question) why didn't you use dart for this?

Nothing against rust, just interested is all considering the dart/flutter relationship.

2 comments

Performance reasons, also wanted it to work on the web (Flutter web support is fairly recent, and dart/flutter libraries don't automatically work on the web, they have to support the platform).
Thanks. Is dart performance that bad? I thought it compiled to machine code if needed.

With the web support I was hoping the since dart can be transpiled to JS Flutter might do something similar. I'll have to look into this, I'm learning Dart due to its ability to run on most platforms.

It's hard to say with performance (you need to measure), but I'll point out that for the web, Dart is compiled to JavaScript.

Performance is pretty good, but as with JavaScript performance, there are performance cliffs depending on how well V8, SpiderMonkey, or JavaScriptCore is able to optimize the code. An audio worklet is pretty standalone and compute intensive, so it seems like a good place to use WebAssembly.

It's not great. Especially on the web.
Speaking only for myself, I'm considering Flutter + Rust because I want to write everything in Rust, but there aren't great GUI options for Rust atm. I've heard good things about the rust<->dart bridge so it seems like a reasonable compromise, esp. given the Dart code to write Flutter UIs seems fairly declarative. Hoping to keep most of the logic in Rust and just the view in Flutter/Dart.
yes