Re:JavaScript to Rust and Back Again: A Wasm-Bindgen Tale
by azakai on Thursday April 05, 2018 @11:10AM
(#16765600)
> You don't have to give up any of the Rust language.
I don't know Rust that well, but what about unwinding and multithreading for example - don't you need to give those Rust features up if you don't want to ship any runtime code?
> It's true that you need to ship malloc/free, but that can be really tiny too
True, yeah. It's a tradeoff, though, tiny mallocs will be much slower than an optimized malloc (like dlmalloc) on real-world benchmarks.
Re:JavaScript to Rust and Back Again: A Wasm-Bindgen Tale
by mmstick on Saturday April 07, 2018 @10:38PM
(#16784299)
Rust doesn't have a runtime, so there's no runtime code to ship in the first place. It's as low level as C, but with a modern syntax and accompanying core and standard libraries. Thread support is done by using existing OS primitives for threading.
It's true that you need to ship malloc/free, but that can be really tiny too; https://github.com/fitzgen/wee_alloc is less than a kilobyte.