This got really rambley so I’m collapsing it. I try to predict the future and wish everyone could have more time to get future work done now.
As a user, I’d note that I prefer a consistent experience between platforms more than a truly native UI.
That said, modal dialogs that really should be handled by the OS, like file selectors, really should be the native one rather than a cross-platform fake, and confirm/cancel placement should match the platform’s.
As a developer, though, I definitely want to have the choice to write this above “semi-native” portable UI, or to drop down and write native OS UIs.
And in predict the future mode:
I think the ideal end position would be:
- A Rust-first GUI platform, with “semi-native” support for tier1 platforms at least, as well as a fall back for platforms that don’t have that work done yet, and
- For as many GUI platforms as possible, a mature and ergonomic(-as-possible) interop story for writing your “native” GUI in its host language, but writing logic in Rust. (Electron is in this category.)
The first would be the “default” choice for a GUI if you just want something that works across tier1 and maybe tier2 platforms, accelerated by fearless concurrency, but the native interop is there if you want to write a native API.
And ideally, in my ideal scenario, the high level Rust semi-native library plays well with the native libraries, so you can compose them to some extent.
Nothing will beat using the native language to write native GUIs, as the library serves the language it was written for (or in some cases, such as Swift, the language also serves the API design). Rust should not try to replace it, as there’s no way to beat GUI APIs in home turf (yet). Where we can stake a claim is in the semi-native zone, where Electron is used.
To that end, an Electron clone-ish based on Rust/WASM powering it, or even just a really good interop story, is a great place to start. Maybe once js-sys and web-sys are done, we can get node-sys and electron-sys? Maybe we can eventually make an Electron variant powered by Servo instead of Chromium? Who knows? I’m done trying to predict the future for now, but I’m watching with interest.
Whatever the solution, though, it should be async-first and multithreading-first to the very core.