Chapter 6
Hosting Modules Outside the Browser

Now that you’ve learned the ins and outs of creating WebAssembly modules with the wast syntax and with Rust, and you’ve learned how a web browser provides the necessary functionality to host WebAssembly modules, it’s time to take that knowledge to the next level: Rust hosting.

At the very beginning of the book, I asked you to trust me when I told you WebAssembly was about more than just the web—it was about creating portable modules that could be slotted into all kinds of hosts, not just browsers.

In this chapter, I’ll make good on that promise and show you how to write Rust code that performs the same job as a web browser in order to host WebAssembly modules. You’ll see how to load, interpret, and execute those modules as well as how to provide callable host functions and to take advantage of functions and memory exported from a WebAssembly module. By the end of the chapter, you’ll be able to build a console application that can load checkers modules and interactively play them, all without even a hint of the Internet or a web browser.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.181.89