News for hackers. Stuff that matters.

Ask HN: If Dart can do it, then why can't Rust?

I am reading through Dart and Flutter tutorials. And I was wondering, if Dart can be used for developing multiplatform UI, then why can't Rust be used to develop multiplatform UI? What are the challenges?
( 10 comments | 2 points | on HN )
Re:Ask HN: If Dart can do it, then why can't Rust? by wmf on Tuesday January 10, 2023 @04:34PM (#34331844)
There's a lot of work going on in this area. https://raphlinus.github.io/rust/gui/2022/07/15/next-dozen-g...
Re:Ask HN: If Dart can do it, then why can't Rust? by smoldesu on Tuesday January 10, 2023 @04:32PM (#34331829)
Both work fine for either use case. As someone who has written multiplatform UIs in Rust though, I would probably tell most people to use Dart and Flutter.
Re:Ask HN: If Dart can do it, then why can't Rust? by crispinb on Tuesday January 10, 2023 @06:33PM (#34332991)
* * *
Re:Ask HN: If Dart can do it, then why can't Rust? by mikece on Tuesday January 10, 2023 @04:24PM (#34331715)
There's probably no reason it canont be done; the fact that Dart is doing it is because some language was needed for Flutter and the Flutter team chose Dart. In other words: cross-platform UI was the point, not starting with a language and then strapping a cross-platform UI to it (looking at you, Xamarin/MAUI...).
Re:Ask HN: If Dart can do it, then why can't Rust? by thesuperbigfrog on Tuesday January 10, 2023 @05:07PM (#34332244)
Here is my favorite Rust GUI library: https://github.com/emilk/egui

There are many other nice Rust GUI libraries depending on your needs:

https://www.areweguiyet.com/

Re:Ask HN: If Dart can do it, then why can't Rust? by crispinb on Tuesday January 10, 2023 @06:16PM (#34332854)
As others have written, it can.

Dart/Flutter is clearly further along. The main non-technical reason for this is that Flutter is the single blessed UI toolkit for Dart, whereas Rust instead relies on the creative chaos of multiple competing and/or overlapping open source projects. The Dart approach concentrates effort and removes the burdens of choice and intergration from app developers; the Rust approach has more potential for arriving at novel solutions, and is less likely to get trapped by top-down decisions.

It's all pretty promising, and great to have some alternatives to the rather creaky old toolkits we have. I personally think web tech will continue to be a strong contender or many multiplatform apps (for which - Rust has Tauri).

Re:Ask HN: If Dart can do it, then why can't Rust? by not_me_ever on Wednesday January 11, 2023 @03:55AM (#34336505)
I keep hearing this myth from a lot of people who never used Rust. The truth? It is not true.

We (my last team) have been developing cross platform, production ready, multiplatform tools, WITH UI for at least 2 years now; And that was 3 months after starting to use Rust.

Re:Ask HN: If Dart can do it, then why can't Rust? by _448 on Wednesday January 11, 2023 @07:08AM (#34337546)
> We (my last team) have been developing cross platform, production ready, multiplatform tools, WITH UI for at least 2 years now;

Please could you share details on what UI library/framework you are using? And what all platforms your UI is targeting?

Re:Ask HN: If Dart can do it, then why can't Rust? by alexvoda on Wednesday January 11, 2023 @06:49AM (#34337446)
First of all, Rust can be used to develop multiplatform UI.

The difference between Dart and Rust is that Dart is developed solely (or mostly) by Google and therefore Flutter is the one true way to do UI.

With Rust, you have many options none of which are the obvious choice.

Re:Ask HN: If Dart can do it, then why can't Rust? by JediPig on Thursday January 19, 2023 @10:52AM (#34441610)
This question is easily answered if the OP would attempt to UI in rust. Rust isnt there, nor will it ever be. Swift is there cause Apple focus on generating SwiftUI.