Live data from Hacker News

JavaScript to Rust and Back Again: A Wasm-Bindgen Tale

hacks.mozilla.org

1–10 of 79 posts

Re: JavaScript to Rust and Back Again: A Wasm-Bindgen Tale

#3
> Faster-than-JS DOM performance

...

> The wasm-bindgen code generation has been designed with the future host bindings proposal in mind from day 1. As soon as that’s a feature available in WebAssembly, we’ll be able to directly invoke imported functions without any of wasm-bindgen‘s JS shims.

Sweet.

Once again, Rust team knocking it out of the park.

Re: JavaScript to Rust and Back Again: A Wasm-Bindgen Tale

#6

The title "Javascript to Rust and Back Again" had me believing that this would be a tale of how Rust was abandoned in favor of Javascript! I'm so glad to see we're actually talking about wasm interop

At our local Rust meetup we have someone who's gotten WASM running on a microcontroller, so maybe that's not entirely unrealisitic. :P

Re: JavaScript to Rust and Back Again: A Wasm-Bindgen Tale

#7
post #3

> Faster-than-JS DOM performance ... > The wasm-bindgen code generation has been designed with the future host bindings proposal in mind from day 1. As soon as that’s a feature available in WebAssembly, we’ll be able to directly invoke imported functions without any of wasm-bindgen‘s JS shims. Sweet. Once again, Rust team knocking it out of the park.

"Faster-than-JS DOM performance"

That will be when the clock starts ticking on Javascript.

Who'da thunk one language might eventually eat both a significant chunk of C and a significant chunk of Javascript someday?

I'm not saying Rust will completely eat Javascript; there is no chance that all web developers would or even necessarily could switch to Rust. But the framework war will take a very interesting turn if Rust gets faster access to the DOM than JS can provide, and is also a faster language than JS, and also tends to afford the use of more efficient constructs that Javascript can provide (i.e., can't do anything about cache coherency in JS, can't manage how much copying you do in JS directly, etc.). And if the ball starts rolling on this, the browsers will start doing things like allowing WASM to register correctly-typed events handlers that don't have to be marshaled into JS and back... it's been a long road and there's a long road ahead still but do I see the glimmer of a world in which browsers can actually perform within a factor of 2 of native UIs?

Re: JavaScript to Rust and Back Again: A Wasm-Bindgen Tale

#8
post #6

The title "Javascript to Rust and Back Again" had me believing that this would be a tale of how Rust was abandoned in favor of Javascript! I'm so glad to see we're actually talking about wasm interop

At our local Rust meetup we have someone who's gotten WASM running on a microcontroller, so maybe that's not entirely unrealisitic. :P

Wait, who was that?

Re: JavaScript to Rust and Back Again: A Wasm-Bindgen Tale

#9
post #7
post #3

> Faster-than-JS DOM performance ... > The wasm-bindgen code generation has been designed with the future host bindings proposal in mind from day 1. As soon as that’s a feature available in WebAssembly, we’ll be able to directly invoke imported functions without any of wasm-bindgen‘s JS shims. Sweet. Once again, Rust team knocking it out of the park.

"Faster-than-JS DOM performance" That will be when the clock starts ticking on Javascript. Who'da thunk one language might eventually eat both a significant chunk of C and a significant chunk of Javascript someday? I'm not saying Rust will completely eat Javascript; there is no chance that all web developers would or even necessarily could switch to Rust. But the framework war will take a very interesting turn if Rus…

Rust is also still very far from having eaten any significant chunk of C.

Re: JavaScript to Rust and Back Again: A Wasm-Bindgen Tale

#10
post #7
post #3

> Faster-than-JS DOM performance ... > The wasm-bindgen code generation has been designed with the future host bindings proposal in mind from day 1. As soon as that’s a feature available in WebAssembly, we’ll be able to directly invoke imported functions without any of wasm-bindgen‘s JS shims. Sweet. Once again, Rust team knocking it out of the park.

"Faster-than-JS DOM performance" That will be when the clock starts ticking on Javascript. Who'da thunk one language might eventually eat both a significant chunk of C and a significant chunk of Javascript someday? I'm not saying Rust will completely eat Javascript; there is no chance that all web developers would or even necessarily could switch to Rust. But the framework war will take a very interesting turn if Rus…

Is JS even the speed problem or is it banging on the DOM all the time?
Post reply on HN