If you're wandering into this tutorial, or even if you searched for it, you're probably wondering exactly what WebAssembly actually is.
Well in simple terms WebAssembly is a way to run sandboxed, performance minded low level code like Rust, C/C++ inside the browser.
All while still maintaining the flexibility to interact with modern web browsers and being functionally useful for web development.
Web Assembly (or WASM for short) is composed of two essential parts that interact with the modern web browser(technology) environment:
Additionally this tutorial demonstrates the usage of WebSockets (RFC 6455). WebSockets allow for full-duplex communications over a single TCP connection which minimizes server-overhead while not facing the complexity of previous implementations of this types like Comet.
The WASM Binary
The Javascript Glue


For the purposes of this tutorial, we are interested in the WASM/Browser interop that allows us to demonstrate directly interacting with elements of the HTML document without needing to specifically use any javascript at all on our end, while demonstrating the use of an advanced networking feature, websockets.
This project is completely based on the Rust crate called stdweb
stdweb is essentially a binding agent for creating the linkages required for compiling to WASM. The crate exposes a series of ways to interact with the browser through internal methods that correspond to javascript bindings without having to actually write javascript. The compiler takes care of everything.
If you would like to read more about WASM, please go to Mozilla's developer page, this will also give you additional API resources and tutorials on how to use WASM. MDN Documentation : WebAssembly