More of a comparison between WebAssembly and JavaScript, really. That the WebAssembly was compiled from Rust is not especially meaningful here.
From the user-experience perspective, it matters that it is Rust. Unless you directly write WASM code, which is rarely (ever) the case. Rust is a language that compiles to WASM. Sure, there are other options to compile to WASM, but they differ by interface (programming language, library, tooling) and (likely to a lesser degree) - performance.
Comparing Rust and JavaScript
91–97 of 97 posts
Re: Comparing Rust and JavaScript
#92Re: Comparing Rust and JavaScript
#93Earlier quoted context omitted.
Has anyone compiled v8 to WASM so we can finally run JS in the browser? ;)
v8 is a JIT engine, WASM would not support it. JavaScriptCore has been compiled to WASM though: https://mbbill.github.io/JSC.js/ People usually ask why, the answer is usually for fun or for sandboxed plugins.
Re: Comparing Rust and JavaScript
#94More of a comparison between WebAssembly and JavaScript, really. That the WebAssembly was compiled from Rust is not especially meaningful here.
Re: Comparing Rust and JavaScript
#95Earlier quoted context omitted.
Has anyone compiled v8 to WASM so we can finally run JS in the browser? ;)
v8 is a JIT engine, WASM would not support it. JavaScriptCore has been compiled to WASM though: https://mbbill.github.io/JSC.js/ People usually ask why, the answer is usually for fun or for sandboxed plugins.
Re: Comparing Rust and JavaScript
#96Earlier quoted context omitted.
Last I checked, destructuring created 4-5x as many bytecode instructions and a potential GC pause. I'd think this could be detected and optimized easily enough, but I guess there are bigger problems for the JIT devs to solve. A quick profiling seemed to indicate that just a bit less than 10% of the JS time is being spent on the DOM rather than the calculations at hand. I wonder how much of that could be reclaimed sim…
I actually thought Math.max was faster in modern Chrome than a ternary.
https://www.measurethat.net/Benchmarks/Show/6528/0/mathmin-v...