3 ms·
Rust has the best tooling for wasm and is easiest to get started with, in my opinion. `rustup target add wasm32-unknown-unknown` `cargo build --target=wasm32-
by the_duke 6y ago
Rust has the best tooling for wasm and is easiest to get started with, in my opinion.
`rustup target add wasm32-unknown-unknown`
`cargo build --target=wasm32-unknown-unknown`
Is all you need to compile a Rust library to a `.wasm` file. (almost, you also need a setting in Cargo.toml: [lib] crate-type = ["cdylib", "rlib"] )
In the browser you can get access to DOM apis via web-sys.
The documentation has quite a lot of examples and info: https://rustwasm.github.io/wasm-bindgen/web-sys/index.html https://rustwasm.github.io/wasm-bindgen/web-sys/index.html
wasm-pack (https://github.com/rustwasm/wasm-pack https://github.com/rustwasm/wasm-pack) makes building code for the browser easy.
- McGlockenshire 6y ago> In the browser you can get access to DOM apis via web-sys. Wow! The last time I looked, doing anything remotely like this was a gigantic pain, in any language. I guess it's finally time for me to get around to learning Rust.