Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> At best you'll get a Rust'ish WASM, Python'ish WASM, PHP'ish WASM, etc

I agree with the latter two due to runtime uniqueness, but not so sure it holds for Rust. Since C FFI has become the defacto WASM standard (with higher level interop coming as the article suggests), some low-overhead langs like Rust can be reasonably used elsewhere via WASM (though in most cases, you'd use them as native libs if you had the option).

Essentially it comes down to two things: How much of the WASM conformance is language-specific at compile time (e.g. for Go, stack resumption is manually built causing bloated WASM), and how much overhead does WASM interop cause at runtime (e.g. can it use the string interface type instead of converting to what it considers a string in local memory and what are the tradeoffs of each approach). If your language has a low WASM impedance mismatch at compile time and runtime, like Rust, it is a decent candidate for a WASM target. If your runtime has a low WASM impedance mismatch (e.g. the browser, native, and to some extent the JVM), it is a decent candidate to run that other decent-candidate WASM code without a huge overhead.

I've run Rust on the JVM [0], C in the browser, etc with decent performance because of those characteristics.

0 - https://github.com/cretz/asmble/tree/master/examples/rust-re...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: