There is a built in wasm targeter that is in the Rust compiler. This was very interesting. So I tried it out! I wrote out some code and I compiled it.
Command to Compile to Wasm
cargo +nightly build --target wasm32-unknown-unknown --release
This Rust code is basically the same as last weeks. What surprised menu greatly, is that this code was compiled in like 2 seconds using the Rust compiler! Last weeks compilation took 90 seconds through emcc. The only difference between the two compilation steps was that emcc ouptutted a wasm file as well as a js file. The Rust compiler outputted just a wasm file.
Now here is the part that is different than last week. The way to import a wasm file is through a network request. I decided to use a fetch API, in order to get the wasm file.