Hacker News new | ask | show | jobs
by bykhun 1024 days ago
I wonder if we can reliably expect React-in-Rust framework that compiles to wasm instead of js? Or maybe just a React library written in Rust, but you can still write the source code in javascript?

Or maybe at least Typescript-to-WASM compiler to skip JS output?

4 comments

I mean probably, yeah, but why? You'd still need JS to involve the DOM with anything, and that's the performance expensive stuff, so might as well just do the whole thing in JS.
Isn't there work on letting WASM call the DOM/Browser API's directly without having to go through JavaScript?
Like nuclear fusion, it’s always just over the horizon.
I doubt the gains from React rewritten in Rust would be significant; the expensive code is the stuff you write in components

Also Typescript -> WASM exists in some form through assemblyscript

Seems a bit silly injecting all that garbage collected untyped stuff straight back into a context where one of the aims was to get rid of it
At that point, why even bother with React? Just write a real user interface.
React-likes (including Vue, Preact, etc) have the most ergonomic interface for UX devs to develop with.
What do you define as a "real" user interface?