Hacker News new | ask | show | jobs
by bryanlarsen 1312 days ago
Rust is pretty much the only language that runs well on all of front-end, back-end, iOS, Android, Windows & MacOS, with decent UI bindings.

Javascript is the only real competition, but the needed shims are lossy at times.

C++ is the closest, but Dioxus and Cacao are nicer than anything in the C++ ecosystem AFAICT.

It's perhaps not the ideal language for any of those, but there's substantial benefit to having your whole team in the same ecosystem.

4 comments

QT is still far ahead.

This isn't a dig on Rust, but wherever Rust runs, so does C++. There are a lot of dimensions where Rust is better, but definitely not "runs everywhere" and "ecosystem".

Compare this demo: https://www.qt.io/web-assembly-example-pizza-shop?hsCtaTrack...

with this demo: https://github.com/DioxusLabs/example-projects/tree/master/e...

QT is unusably slow. Dioxus is indistinguishable from a Javascript app.

My main gripe with QT is that apps created with it are, as a rule, ugly and non-native feeling.

My suspicion is that this is because QT widgets sort of look like native widgets but aren’t quite there, causing it to fall into some kind of “uncanny valley” analogue.

From my experience, the same is true for most Rust frameworks. In fact, I don't think there's a single stable Rust GUI library that tries to accommodate system controls.

You can use the win32 API on Windows and Gtk on GNOME, but for KDE and all else you'll need to use some kind of Qt wrapper that has the problems you encounter.

IME your rust apps should use native frameworks. Cacao for iOS, Dioxus for web, etc.
C++ does not run as well on the browser.

Yes, QT on the desktop is very good. There are bindings for Rust too, as there are for most languages, but the most integrated one is C++. (I'd say the close integration is just not worth it.)

Anyway, I don't know why people want so badly a single language to run on every context. They are forfeiting a lot of value for that.

Runs well in a browser, with ergonomic integration with HTML, CSS, and other browser APIs?
Yes. It's new enough that you will find a bug or two, but it's about as closely integrated as Javascript.
Yes, check out Dioxus, which is essentially React for Rust, and is faster than react at many tasks.
How does rust run on the front-end? Or is this the compile to wasm thing?
Java?
Do Java applets even work on the modern web?
I don't think so, but there're solutions for Java to JS transpiling.