3 ms·
Rusts wasm32-wasi and wasm32-unknown-unknown targets don't depend on Emscripten and they've been the preferred ways of targeting wasm for years now. There is a
by jsheard 4y ago
Rusts wasm32-wasi and wasm32-unknown-unknown targets don't depend on Emscripten and they've been the preferred ways of targeting wasm for years now.
There is a wasm32-unknown-emscripten target but I think that's basically on life support if not outright deprecated. It was only really a stop-gap until native tooling like wasm_bindgen got fleshed out.
- azakai 4y agowasm32-unknown-emscripten is useful if you want to build a Rust program using SDL2 and GL for the Web, for example. But yes, as you said, it's much less used. Most Rust code on the Web is not a port of existing applications (which is what Emscripten focuses on), unlike C++.
- pjmlp 4y agoPity that not all tutorials have been updated, as I recently hit that bump, unfortunely I don't have the tutorial link any longer.
- jsheard 4y agoIf you're targeting browsers then the Rust WASM book goes over using wasm32-unknown-unknown with wasm_bindgen to auto-generate the JS glue https://rustwasm.github.io/docs/book/ https://rustwasm.github.io/docs/book/ If you're targeting some WASI-based platform then it's more straightforward, since no JS glue is needed. CF have a quick example https://blog.cloudflare.com/announcing-wasi-on-workers/ https://blog.cloudflare.com/announcing-wasi-on-workers/
- pjmlp 4y agoThanks for the links.