In this series of WebAssembly, We are learning about WebAssembly and some of the cool CLI to play with wasm. In this blog, We are going to learn the hosting of our wasm modules in Rust. If you have not been following this series, you can check out the previous blogs related to WebAssembly, WABT and wasm-bindgen to give you an idea about wasm. Now let’s begin.
Till now, you have seen that we have been hosting WebAssembly modules in_web browsers_, but that is not the only way to do so. We can host a wasm module outside a web browser like a Rust program.
We will see how to do it. To do so, we will need a crate called wasmi, but before that, let’s see the qualities of a good host.
To be a good host, you need to do all the following things,
Any application acting as a host is responsible for loading the bytes from that file and validating that all of the preconditions for the raw format of the file are correct.
#rust #hosting #wasm #wasmi #webassembly