Thanks to wasm, Rust can reach the platform with the largest reach: the browser. We’ll take a look at how thanks to the impressive language design, thoughtful compiler error messages, and great documentation, JavaScripters can unlock high-performance concurrency and graphics thanks to Rust. We’ll step through Rust/wasm/JS interop, see what it’s like to get a reference to a canvas instance, to communicate with services workers, and to pass data between all the pieces involved. We’ll take a look at what’s enabled, as well as pitfalls around the data boundaries involved, and the size of the final payload, so that it’s clear where the cost of introducing Rust is outweighed by its benefits. Finally, we’ll speculate on how the web may develop, with a Rust-core/JavaScript-surface design, combining high performance, safety, while maintaining ease-of-use.

Why even though Rust requires more effort, it’s approachable for JavaScript developers. How Rust combines with service workers and WebGL open new possibilities? What does Rust/JS interop look like, and what are the steps involved?

There’s a reasonable chance that the future of WebUI will have Rust at its core.

#javascript #rust

Rust in the Browser for JavaScripters: New Frontiers, New Possibilities
3 Likes34.70 GEEK