Introduction - Rust and WebAssembly (original) (raw)

  1. 1. Introduction
  2. 2. Why Rust and WebAssembly?
  3. 3. Background And Concepts
    1. 3.1. What is WebAssembly?
  4. 4. Tutorial
    1. 4.1. Setup
    2. 4.2. Hello, World!
    3. 4.3. Rules
    4. 4.4. Implementing Life
    5. 4.5. Testing Life
    6. 4.6. Debugging
    7. 4.7. Adding Interactivity
    8. 4.8. Time Profiling
    9. 4.9. Shrinking .wasm Size
    10. 4.10. Publishing to npm
  5. 5. Reference
    1. 5.1. Crates You Should Know
    2. 5.2. Tools You Should Know
    3. 5.3. Project Templates
    4. 5.4. Debugging
    5. 5.5. Time Profiling
    6. 5.6. Shrinking .wasm Size
    7. 5.7. JavaScript Interoperation
    8. 5.8. Which Crates Will Work Off-the-Shelf with WebAssembly?
    9. 5.9. How to Add WebAssembly Support to a General-Purpose Crate
    10. 5.10. Deploying Rust and WebAssembly to Production

Rust and WebAssembly

Rust 🦀 and WebAssembly 🕸

This small book describes how to use Rust and WebAssembly together.

Who is this book for?

This book is for anyone interested in compiling Rust to WebAssembly for fast, reliable code on the Web. You should know some Rust, and be familiar with JavaScript, HTML, and CSS. You don't need to be an expert in any of them.

Don't know Rust yet? Start with The Rust Programming Language first.

Don't know JavaScript, HTML, or CSS? Learn about them on MDN.

How to read this book

You should read the motivation for using Rust and WebAssembly together, as well as familiarize yourself with the background and concepts first.

The tutorial is written to be read from start to finish. You should follow along: writing, compiling, and running the tutorial's code yourself. If you haven't used Rust and WebAssembly together before, do the tutorial!

The reference sections may be perused in any order.

💡 Tip: You can search through this book by clicking on the 🔍 icon at the top of the page, or by pressing the s key.

Contributing to this book

This book is open source! Find a typo? Did we overlook something? Send us a pull request!