Comment on Rust 1.39parentComments−TazeTSchnitzel6yIt's a pleasant suprise how easy targeting wasm is from Rust. Just pass on the right `--target` flag to `cargo build` if you have the toolchain installed.−MaulingMonkey6yAnd installing the right target is typically as simple as: rustup target add wasm32-unknown-unknown Targeting browser APIs is a little more involved, generally requiring either: cargo install cargo-web cargo web build [...] for stdweb, or for web-sys: cargo install wasm-pack wasm-pack build [...]−johnisgood6yIn all fairness, `GOARCH=wasm GOOS=js go build` is just as easy.
Comments
It's a pleasant suprise how easy targeting wasm is from Rust. Just pass on the right `--target` flag to `cargo build` if you have the toolchain installed.
And installing the right target is typically as simple as:
Targeting browser APIs is a little more involved, generally requiring either: for stdweb, or for web-sys:In all fairness, `GOARCH=wasm GOOS=js go build` is just as easy.