Chapter 3
Wading into WebAssembly with Rust

The first part of this book introduced you to the world of WebAssembly. You learned about its internals and its architecture, what stack machines are, and where WebAssembly fits within the larger world of web applications. You even built a mostly functioning checkers module entirely in wast, the text representation of WebAssembly instructions.

In this part of the book, you will focus not only on increasing your ability to interweave WebAssembly and JavaScript functionality, but you will also go through an introduction to Rust and you will see how you can use it to add strong types, memory safety, and elegant, expressive code to your WebAssembly modules.

In this chapter, you’ll get an introduction to Rust and get your workstation tooling set up to target WebAssembly from Rust. By the end of this chapter, you’ll build a new version of the checkers module entirely in Rust. The Rust language has a longer learning curve than other languages like Go. As such, you might want to start skimming through the official Rust book[9] to get familiar with some of the syntax coming up in the book. It’s not required, but consulting multiple reference sources is never a bad idea.

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

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