My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Rust to WebAssembly compilation

Marco Alka's photo
Marco Alka
·Dec 28, 2016

Bringing together two techs I love: Rust and the Web!

Usage is very straight forward:

$ echo 'fn main() { println!("Hello, Emscripten!"); }' > hello.rs
$ rustc --target=asmjs-unknown-emscripten hello.rs
$ node hello.js

Nice thing to know: The result is a "just run it" thing, which packs a whole wasm interpreter with your code, so it doesn't even matter if your JS engine supports wasm! Only downside: It's beta, it's untested, it's slow. But heyy, everything starts out at some point :)