3 ms·
There was a PR recently which support wasm compilation without emcc. Does anyone know when it is expected in stable? https://github.com/rust-lang/rust/pull/459
by akmittal 9y ago
There was a PR recently which support wasm compilation without emcc. Does anyone know when it is expected in stable?
https://github.com/rust-lang/rust/pull/45905 https://github.com/rust-lang/rust/pull/45905
- killercup 9y agoGood question! It was merged quite close to the release, so it's hard to guess if it landed in beta already. So, let's have a look at [1]! And yep, it's in the beta branch. This means it's in 1.23, which'll be released in 6 weeks. [1]: https://github.com/rust-lang/rust/commits/beta https://github.com/rust-lang/rust/commits/beta
- MrBuddyCasino 9y agoDoes that mean I will be able to compile to wasm via a simple cargo parameter? If so - wow!
- killercup 9y agoYes, once [1] lands, you can add it with `rustup target add wasm32-unknown-unknown` and then you can `cargo build --target=wasm32-unknown-unknown`. You should note that it's not as simple as that, though. Depending on the context you want to run WASM you might need to do additional steps. E.g., when running this in a browser, you might not be able to use the std lib to spawn threads just yet. [1]: https://github.com/rust-lang/rust/pull/46115 https://github.com/rust-lang/rust/pull/46115