Chapter 8
Building WARoS—The WebAssembly Robot System

We started this book by going over the fundamentals of what WebAssembly is, how it works, and what its raw text format looks like. In later chapters, you learned how to build WebAssembly modules that can interact with browser hosts and use advanced UI libraries to build full-featured “pure WebAssembly” web applications.

Then we ventured into the realm of non-browser hosts, and you learned how to write Rust code that can load, validate, and interpret a WebAssembly module. We put this into action by writing a console-based checkers host and even a Raspberry Pi host that allowed a WebAssembly module to manipulate LEDs.

In this chapter, you’re going to take everything you’ve learned and apply it to building a Rust host that can load multiple WebAssembly “robots” into a virtual arena, pit them against each other, and run all of the game logic. You’ll not only learn how to build this code, but I’ll also illustrate multiple extension points where you can add a ton of cool, cloud-based features to this game.

This chapter will be the heaviest in terms of exposure to advanced Rust topics, like shared, mutable state across threads and some pretty intricate use of borrows and moves. While building the game in this chapter, you’ll learn a lot about Rust, and the game will provide a fun tool you can use to continue learning and exploring Rust and WebAssembly.

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

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