Start by assembling a 41-byte module by hand, then learn the WAT text format, compiling from Rust, how to measure speed, and uses outside the browser, over 30 lessons. Our subject is Komugi Filter, a small tool that edits a bakery's product photos. You'll write the same processing in JavaScript, WAT, and Rust, and actually compare them.
about 2 hours in total (estimate)
The 30 lessons are split into 6 chapters. We recommend working through them in order starting from Chapter 1. * Short experiments run in your browser. On your own machine you'll use Node.js 22 or later, plus Rust from Chapter 3 (all output in this course was produced with Node.js 26.13.0, wabt 1.0.39, and Rust 1.94.1).
Take this chapter's review quiz ›
Learn what bytes a WebAssembly module is made of and how it runs. Assemble a 41-byte module by hand, rewrite it in the WAT text format, and check how the stack machine works and how it talks to JavaScript.
Take this chapter's review quiz ›
Write branches and loops, linear memory, string passing, and function tables in WAT. At the end of the chapter, write Komugi Filter's first operation, turning an image gray, in WAT and compare it with JavaScript.
Take this chapter's review quiz ›
Instead of writing WAT by hand, write Rust and compile it to wasm. Start with the bare approach of exporting functions the way C does, then learn memory allocation, automating the glue with wasm-bindgen, and trimming size, and finally write image blurring in Rust.
Take this chapter's review quiz ›
Check, with fair measurements, whether wasm is really fast. Learn the cost of crossing the boundary with JavaScript, handling 16 bytes at once with SIMD, and splitting work across Workers, and finish with cases where changing the method beats changing the language.
Take this chapter's review quiz ›
Use wasm outside the browser. Turn it into a Node.js command, read and write files with WASI, and confirm its nature as a sandbox that can touch only what it's given. Finally, safely run wasm written by others as plugins, and build a component usable across languages.
Take this chapter's review quiz ›
Package Komugi Filter as an app usable in the browser. Run the wasm in a Worker, speed up loading, make failures diagnosable, and protect correctness with tests. Finally, line up the numbers measured over 30 lessons and look back.
Once you've finished all 30 lessons, head to Rust to go deeper in a language that compiles to wasm, or to Node.js to run JavaScript and wasm outside the browser. A membership unlocks every course.