4 ms·
If there was a superset of Rust where everything was transparently reference counted, every data structure could hold mixed types easily, and closures were dead
by lucasyvas 4y ago
If there was a superset of Rust where everything was transparently reference counted, every data structure could hold mixed types easily, and closures were dead simple, then maybe.
These are things that are, IMO, just too engrained as being possible in JS/TS for people to give up easily, especially in terms of UI programming.
I've used both quite a bit - I am pulling for Rust to become more ergonomic for this use case where it makes sense because it has lots of other advantages.
But when the rubber hits the road and you start writing, I think Rust gets in the way too much for UI programming. For a small project it may be OK, but in most orgs you have sweeping design changes occurring (probably too) often. Rust is best when things have stopped churning and stabilize.
UI code often churns like a relentless beast, so something extremely approachable/flexible but strongly typed is best I think. This is why TypeScript is winning in this arena.
I'm optimistic headway will be made, but Rust currently feels a lot better to write for back-end and systems. It's not a surprise since that's what it was designed for.
Besides all this, I'm totally unsure where the size of the distributable comes in. In JS things can be chunked per page easily which keeps load times small. With WASM you get the whole thing by default, correct? That could be problematic.