small medium large xlarge

Programming WebAssembly with Rust: Unified Development for Web, Mobile, and Embedded Applications

by

Cover image for Programming WebAssembly with Rust

Programming WebAssembly with Rust

Unified Development for Web, Mobile, and Embedded Applications

by

WebAssembly fulfills the long-awaited promise of web technologies: fast code, type-safe at compile time, execution in the browser, on embedded devices, or anywhere else. Rust delivers the power of C in a language that strictly enforces type safety. Combine both languages and you can write for the web like never before! Learn how to integrate with JavaScript, run code on platforms other than the browser, and take a step into IoT. Discover the easy way to build cross-platform applications without sacrificing power, and change the way you write code for the web.

Customer Reviews

Concise and well-paced, this book quickly dives into the details of WebAssembly, letting readers get their hands dirty building interesting Wasm applications. It’s loaded with great examples and touches on many different aspects of programming while paving the trail for WebAssembly development.

- Sean Boyle

Senior Software Engineer, Cerner

Programming WebAssembly with Rust is a great resource for learning a low-level language (WebAssembly) and showing how its power can be harnessed with Rust. It is perfect for people who like to understand how things work.

- Jason Pike

Software Development Coach, Sigao Studios

Starting with a detailed look at WebAssembly internals and the WAST language before moving on to solving fun gaming problems with Rust and Wasm, Programming WebAssembly with Rust ensures readers gain a foundational knowledge of WebAssembly and have fun doing so.

- Balaji Sivaraman

Senior Technology Consultant, ThoughtWorks

I read Programming WebAssembly with Rust hardly knowing anything about either. I came away planning to make some time to build a WebAssembly module and publish to an npm registry—and with a clear idea of how to do so. An enjoyable read which suggests some mind-bending possibilities for the future of the web.

- Stephen Wolff

Director, Max Gate Digital, Ltd.

See All Reviews

Choose Your Format(s)

  • $24.95 In Stock
  • Ebooks are DRM free.

  • Ebook delivery options.

What You Need

You’ll need a Linux, Mac, or Windows workstation with an Internet connection. You’ll need an up-to-date web browser that supports WebAssembly. To work with the sample code, you can use your favorite text editor or IDE. The book will guide you through installing the Rust and WebAssembly tools needed for each chapter.

Contents & Extracts

  • Introduction
  • Building a Foundation
    • WebAssembly Fundamentals excerpt
      • Introducing WebAssembly
      • Understanding WebAssembly Architecture
      • Building a WebAssembly Application
      • Wrapping Up
    • Building WebAssembly Checkers
      • Playing Checkers, the Board Game
      • Coping with Data Structure Constraints
      • Implementing Game Rules
      • Moving Players
      • Testing Wasm Checkers
      • Wrapping Up
  • Interacting with JavaScript
    • Wading into WebAssembly with Rust
      • Introducing Rust
      • Installing Rust
      • Building Hello WebAssembly in Rust
      • Creating Rusty Checkers
      • Coding the Rusty Checkers WebAssembly Interface
      • Playing Rusty Checkers in JavaScript
      • Wrapping Up
    • Integrating WebAssembly with JavaScript
      • Creating a Better “Hello, World”
      • Building the Rogue WebAssembly Game
      • Experimenting Further
      • Wrapping Up
    • Advanced JavaScript Integration with Yew
      • Getting Started with Yew
      • Building a Live Chat Application
      • Wrapping Up
  • Working with Non-Web Hosts
    • Hosting Modules Outside the Browser
      • How to Be a Good Host
      • Interpreting WebAssembly Modules with Rust
      • Building a Console Host Checkers Player
      • Wrapping Up
    • Exploring the Internet of WebAssembly Things excerpt
      • Overview of the Generic Indicator Module
      • Creating Indicator Modules
      • Building Rust Applications for ARM Devices
      • Hosting Indicator Modules on a Raspberry Pi
      • Hardware Shopping List
      • Endless Possibilities
      • Wrapping Up
    • Building WARoS—-The WebAssembly Robot System
      • An Homage to Crobots
      • Designing the WARoS API
      • Building the WARoS Match Engine
      • Creating WebAssembly Robots
      • Robots in the Cloud
      • Wrapping Up
      • Conclusion

Author

Kevin Hoffman got his start programming at the age of 10 with a Commodore VIC-20, a cassette drive, and a hand-altered floppy disc drive from a Commodore 64. He has worked in dozens of industries from gaming to waste management, from drones to biometric security, and finance. He has written or co-written over 20 technology books and looks forward to someday completing his fantasy trilogy — the Sigilord Chronicles.