back

by dmit·5y ago·view on hn ↗
How come? Wasm is only at ~92% browser adoption right now (per https://caniuse.com/?search=wasm), but certain classes of apps can easily take that 8% hit for all the benefits over the status quo languages that Rust brings.

You get painless sharing of domain types between client and server via serde; you still get native async/await support; you get more powerful data modeling features than even Typescript can provide (although Typescript's union types are definitely much more ergonomic). You get a standard library that's not a joke. You don't have to wait until proposal-temporal gets ratified and implemented in order to have sane date/time handling (recently hit Stage 3 btw, woo!).

Honestly, only ScalaJS can match all of those benefits, as far as I can tell after examining a dozen of languages targeting the web.

So yeah, I'm super curious to hear what problems you encountered with Rust as a web frontend language.

1 comments
> although Typescript's union types are definitely much more ergonomic

meh. Doing tricky stuff with them is far easier as TS is a dynamic language, but the fact that enum variants are each a variant makes constructing them really easy:

  let array = [1, 2, 3];
  let some_array: Option<i32> = array.iter().map(Some).collect();