Earlier quoted context omitted.
Rust has some significant advantages compared to languages like Kotlin, Java, and C# here. A really big one is binary sizes. To get those languages to work, you have to ship the entire runtime. For example, see https://www.infoq.com/news/2018/01/mono-cs-webassembly > (the "hello world" example is 10 megabytes) The "hello world" example in Rust is ~100 bytes . Some applications and some people can pay these costs, it'…
Java and .NET also have linkers, which can help bring down that size, even if not as much as Rust.
JavaScript to Rust and Back Again: A Wasm-Bindgen Tale
31–40 of 79 posts
Re: JavaScript to Rust and Back Again: A Wasm-Bindgen Tale
#32Re: JavaScript to Rust and Back Again: A Wasm-Bindgen Tale
#33Does anybody know what debugging will look like here? Will LLDB work?
Re: JavaScript to Rust and Back Again: A Wasm-Bindgen Tale
#34Earlier quoted context omitted.
"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?
Mozilla has been doing a lot of work on this front. The Servo project demonstrated you can do style and reflow in parallel. Pieces of that effort have been pulled into Firefox under the "Quantum" label but not the actual reflow part. They're in the process of finishing and incorporating WebRender to make paint more efficient and GPU driven and there have also been efforts at building new drawing APIs (PathTracer, Lyon) as part of that project.
I know Chrome had been doing experiments with implementing DOM methods in Javascript to avoid having to cross the JS/C++ barrier in v8 but I haven't heard about that in a while nor any other major DOM-related perf projects out of them.
Fairly long answer to a short question. If the new APIs retain the synchronous nature of the current DOM APIs where reads against the DOM state force previous DOM manipulations are blocked until a forced layout happens (I hope they are) then it'll still be possible to DOM thrash and kill your perf that way. I also suspect there's enough overhead in JS->DOM calls that WASM could pick up a double digit perf gain in microbenchmarks but not an order of magnitude with the caveat that's a fairly uninformed guess.
Re: JavaScript to Rust and Back Again: A Wasm-Bindgen Tale
#35Earlier quoted context omitted.
Rust isn't the only player here. Kotlin I think does webasm already. And I think Java and C# will also jump on the bandwagon eventually.
Rust has some significant advantages compared to languages like Kotlin, Java, and C# here. A really big one is binary sizes. To get those languages to work, you have to ship the entire runtime. For example, see https://www.infoq.com/news/2018/01/mono-cs-webassembly > (the "hello world" example is 10 megabytes) The "hello world" example in Rust is ~100 bytes . Some applications and some people can pay these costs, it'…
Re: JavaScript to Rust and Back Again: A Wasm-Bindgen Tale
#36Earlier quoted context omitted.
Do you see any reason why it won't eventually do so?
The other question is whether there actually is a reason that it will eventually do so. I personally have my doubts. C has found that perfect sweet spot between not getting in the way of doing things and running on almost any platform. Rust still has to achieve that status and judging from other competitors like C++/D it seems hard to get to that point. Heck, even Java was advertised as systems language on Java CPUs…
That is the question. The way I see it, Rust's attractiveness to C developers goes up considerably the more accountable they are for the code they ship. If IoT and embedded devices start having repercussions for out of date, exploitable firmware/services, either through public opinion, legal or legislative means, making a switch to a language that provides more guarantees starts to look a lot more feasible and attractive to a lot of C die-hards.
Re: JavaScript to Rust and Back Again: A Wasm-Bindgen Tale
#37Earlier quoted context omitted.
The other question is whether there actually is a reason that it will eventually do so. I personally have my doubts. C has found that perfect sweet spot between not getting in the way of doing things and running on almost any platform. Rust still has to achieve that status and judging from other competitors like C++/D it seems hard to get to that point. Heck, even Java was advertised as systems language on Java CPUs…
> The other question is whether there actually is a reason that it will eventually do so. I personally have my doubts. C has found that perfect sweet spot between not getting in the way of doing things and running on almost any platform. That is the question. The way I see it, Rust's attractiveness to C developers goes up considerably the more accountable they are for the code they ship. If IoT and embedded devices s…
Re: JavaScript to Rust and Back Again: A Wasm-Bindgen Tale
#38Earlier quoted context omitted.
Is JS even the speed problem or is it banging on the DOM all the time?
It might help to think speed as lower power consumption. So yes. As long as cellphones and laptops need a battery.
Re: JavaScript to Rust and Back Again: A Wasm-Bindgen Tale
#39Earlier quoted context omitted.
Rust has some significant advantages compared to languages like Kotlin, Java, and C# here. A really big one is binary sizes. To get those languages to work, you have to ship the entire runtime. For example, see https://www.infoq.com/news/2018/01/mono-cs-webassembly > (the "hello world" example is 10 megabytes) The "hello world" example in Rust is ~100 bytes . Some applications and some people can pay these costs, it'…
Doesn't the small size only apply if you compile to assembly? If you compile to webasm shouldn't things be different? I am assuming a C# to webasm would be very different from the current C# to IL compiler.
I'm not sure what you mean, could you re-phrase maybe? The article is talking about compiling to WebAssembly already.
Re: JavaScript to Rust and Back Again: A Wasm-Bindgen Tale
#40Earlier quoted context omitted.
Doesn't the small size only apply if you compile to assembly? If you compile to webasm shouldn't things be different? I am assuming a C# to webasm would be very different from the current C# to IL compiler.
> Doesn't the small size only apply if you compile to assembly? If you compile to webasm shouldn't things be different? I'm not sure what you mean, could you re-phrase maybe? The article is talking about compiling to WebAssembly already.