https://rustwasm.github.io/book/
Learning Rust at the same time as Rust+WebAssembly might be a bit of a reach, though.
I don't do well with example-driven documentation like these. Resources like the original rust book are excellent though.
You can just target WebAssembly like this:
cargo +nightly build --target wasm32-unknown-unknown
# Install support for "wasm" command for cargo:
cargo install cargo-wasm
# Install wasm target and wasm-gc tool:
cargo wasm setup
# Create new wasm project:
cargo wasm new hello_world
and then in hello_world directory: # Build and run wasm project:
cargo wasm runHere's one guide: https://hackernoon.com/compiling-rust-to-webassembly-guide-4...
https://webassembly.org/docs/c-and-c++/
"WebAssembly is being designed to support C and C++ code well, right from the start..."
https://github.com/aykevl/tinygo
It's output files are very small (~1kb for the toy examples), as it does dead code elimination, which is missing from the mainline Go approach (for now).
Both Go and TinyGo are in very early stages of their Wasm support though, so things are changing and updating fairly quickly. :)
For Wasm output? It really doesn't seem like it. Output binaries from the mainline Go compiler (atm) are ~2MB. Most of which is dead code.
C# doesn’t get a lot of love on HN, but we’re launching our first Blazor app in production this week and it’s been pretty easy to use.
With garbage collection support landing in WebAssembly we might see compilation of .net IL to WebAssembly, but that’s still out in the future.
It’ll make its way into .net core 3.0, so I think it’s more than just a poc.
It’s early of course and not very flexible, if you want to build something it wasn’t meant for, it breaks.
There are a lot of pros & cons here to this way. Some pros are a fast initial render & small amount of bytes needing to be sent. Cons are you need internet access & render changes aren't as fast as client side.
This biggest pro I see though is being able to develop a front end app that you can later switch to Blazor/Web Assembly with the client taking over part of the logic when Blazor & Web Assembly are less experimental. For internal apps, or apps where you know the internet/network connection should always be good, this is a great way to go.
Like a lot of things these days, Blazor has a website way more polished than the actual product. It's very interesting, but I'm surprised you find it ready for use in production.
Rust has a similar footprint at first sight but can be shrinked significantly:
wasm-gc test.wasm # 1.7MB -> 100 bytes
IMHO the rust language is quite ugly, so you might take a fresh look at c++ which became surprisingly readable with its new features (auto, initializer_lists, nice for loops, ...)
This way you can create production-ready code and be ready to move to WebAssembly as soon as it gets feature ready.
The fine control that C++ offers will help you to understand the underlying architecture and put its performance to test.
Adding multi-threading support for WebAssembly is on the roadmap for 2019.1