Hacker News new | ask | show | jobs
by exomancer 2249 days ago
Rust already has [React-like web framework](https://github.com/yewstack/yew) with a macro for [declarative components](https://github.com/yewstack/yew/blob/ce020d6eb8409b2063cc150...) that compiles to wasm and, last I checked, [runs circles around JS frameworks](https://github.com/DenisKolodin/todomvc-perf-comparison).

I agree that it won't reach the popularity levels of JS due to the learning curve, but on technical side of things future is _now_.

3 comments

yew doesnt run circles around anything:

https://krausest.github.io/js-framework-benchmark/current.ht...

wasm-bindgen seems to do well, though its code is rather imperative.

That benchmark run is about a year old. Yew is v0.15 now (v0.7 came out a year ago) and has improved substantially (and has keyed components now).
Fair enough, I've only seen the one benchmark I've linked.
Yew (and comparable Rust frameworks) do however have a pretty slow compile time and with that a horrible debug-cycle. It's so bad that I in general opt for React-in-Yew for prototyping and only reimplement components with more complex state in Rust.
Do people writing frontend apps really care that much about performance that they'd be willing to switch to Rust? Honest question.
Not likely. The only thing that really matters to me is developer ergonomics. I've never seen a project struggle because it couldn't render a table with a 1,000 rows fast enough. I have seen many projects struggle because they hired a bunch of junior engineers who had difficulty writing clean, maintainable JavaScript.

Rust and WASM will definitely take on for doing things like WebGL. I can't imagine Rust becoming the de-facto solution for building UIs.