4 ms·
Rust’s wasm32-unknown-unknown target does not use emscripten at all. The tool cargo-web will handle the js module shims for you.
by bbatha 9y ago
Rust’s wasm32-unknown-unknown target does not use emscripten at all. The tool cargo-web will handle the js module shims for you.
- Game_Ender 9y agocargo-web uses emscripten under the hood.
- a_humean 9y agoNo, he is right. cargo-web supports three backends, of which only two include emscripten and the third using a native rust backend. https://github.com/koute/cargo-web#features https://github.com/koute/cargo-web#features Rust can be compiled to wasm without emscripten using wasm32-unknown-unknown.
- bringtheaction 9y agoDoes that mean I can install cargo-web without emscripten or do I still need it even though I am not going to use it just because the two other targets use it? In other words, is emscripten an optional or a hard dependency?
- a_humean 9y agoIts an optional dependency. You can build without it by just using a nightly version of rust with the wasm32-unknown-unknown backend. An example of using cargo-web with the stdweb rust project: https://github.com/koute/stdweb#running-the-examples https://github.com/koute/stdweb#running-the-examples