Lessons
Master Rust + WebAssembly step by step
What is WebAssembly?
Understand what WebAssembly is, why it exists, and where Rust fits in — before writing a single line of code.
Rust Basics for Wasm
Learn the essential Rust syntax you need for WebAssembly — functions, types, structs, and error handling. No prior Rust experience needed.
Hello WebAssembly
Your first Rust + WebAssembly project. Learn how wasm-bindgen bridges Rust and JavaScript.
How wasm-bindgen Works
Understand the bridge between Rust and JavaScript — how wasm-bindgen converts types, exports functions, and generates glue code.
DOM Manipulation
Access and modify the browser DOM directly from Rust using web-sys bindings.
Fetch API Calls
Make HTTP requests from Rust/Wasm using the browser's Fetch API with async/await.
Cryptographic Hashing
Implement SHA-256 hashing in Rust/Wasm for client-side data integrity verification.
Particle Simulation
Build a high-performance particle system rendered on HTML Canvas, powered by Rust/Wasm.
Setting Up Your First Project
Create a Rust/Wasm project from scratch with wasm-pack, configure Cargo.toml, and integrate with a JavaScript bundler.
Debugging Wasm
Debug Rust/Wasm applications using console logging, panic hooks, browser DevTools, and error handling best practices.
Canvas & 2D Graphics
Draw shapes, animate sprites, and build interactive graphics using HTML Canvas controlled from Rust/Wasm.
State Management
Share and synchronize state between Rust/Wasm and JavaScript using structs, shared memory, and message passing patterns.
File Processing
Read, process, and generate files client-side using Rust/Wasm — CSV parsing, image manipulation, and file downloads.
WebSockets
Build real-time communication with WebSockets from Rust/Wasm — connect, send, receive, and handle events.
Wasm + Frontend Frameworks
Integrate Rust/Wasm modules with React, Svelte, and Vue — use Wasm for performance-critical logic while keeping your favorite UI framework.
Deploying to Production
Bundle, optimize, and deploy Rust/Wasm applications to Cloudflare Pages, Vercel, Netlify, and other platforms.
Error Handling in Wasm
Handle errors gracefully across the Rust/JavaScript boundary using Result, JsValue, custom errors, and panic hooks.
Testing Wasm
Test Rust/Wasm code with wasm-pack test, headless browsers, and unit tests that run both natively and in the browser.
Wasm + Web Workers
Run Wasm in Web Workers for parallel computation without blocking the main thread — multi-threaded performance in the browser.
Image Processing
Process images client-side with Rust/Wasm — grayscale, blur, brightness, contrast, and pixel manipulation at near-native speed.
Wasm Memory Model
Understand how WebAssembly linear memory works — allocation, growth, views, and sharing data between Rust and JavaScript efficiently.
String Handling Deep Dive
Master string passing between Rust and JavaScript — UTF-8 vs UTF-16 encoding, performance costs, and optimization strategies.
Audio Processing
Process and synthesize audio in real-time with Rust/Wasm and the Web Audio API — filters, effects, and waveform generation.
Building a Wasm Game
Build a complete browser game with Rust/Wasm — game loop, input handling, collision detection, and Canvas rendering.
Wasm Outside the Browser (WASI)
Run WebAssembly outside the browser with WASI — server-side Wasm, edge computing, and portable binaries.
Wasm Performance Profiling
Measure, profile, and optimize Wasm performance — binary size reduction, runtime profiling, and benchmarking techniques.
Wasm Binary Format
Understand the .wasm binary format — modules, sections, WAT text format, and how the browser loads and instantiates Wasm.
Wasm Component Model
The future of WebAssembly — composable modules, typed interfaces, and language-agnostic components that work together.
Closures & Callbacks Between JS and Rust
Learn how Rust closures work across the Wasm boundary — Closure::wrap, Closure::once, the 'static lifetime requirement, passing functions between JS and Rust, and managing closure memory with forget() vs into_js_value().
Wasm Streams & Async Iterators
Work with ReadableStream, WritableStream, and TransformStream from Rust — streaming large files, handling backpressure, and building async iterator pipelines with the wasm-streams crate.
Rust Enums in Wasm
Use Rust enums across the Wasm boundary — C-style enums as numbers, complex enums via serde, wasm_bindgen limitations, serde-wasm-bindgen workarounds, and TypeScript type generation.
Wasm + IndexedDB
Access IndexedDB from Rust via web-sys — create databases, perform CRUD operations, manage transactions, build indexes, and use JsFuture for async database calls.
3D Graphics with WebGL
Build 3D graphics with WebGL from Rust — the rendering pipeline, vertex and fragment shaders, matrix math for rotation and projection, and rendering a spinning cube with camera and lighting.
Wasm Size Optimization
Learn techniques to shrink your Wasm binary — from Cargo.toml tweaks and wasm-opt to tree shaking, avoiding bloat, and measuring with twiggy.
Custom Allocators in Wasm
Understand how Wasm memory allocation works and build your own bump allocator, arena allocator, and GlobalAlloc implementation in Rust.
Wasm + WebRTC
Use Rust and WebAssembly to build peer-to-peer communication with WebRTC — peer connections, data channels, signaling, and ICE candidates.
Serde Serialization for Wasm
Master serde serialization in Wasm — compare serde-wasm-bindgen vs JsValue, serialize complex types, and optimize for performance.
Building a Wasm Plugin System
Design a plugin architecture using WebAssembly — sandboxed, portable, and language-agnostic — with trait-based host-guest communication and resource limits.
Wasm + TypeScript Integration
Bridge Rust and TypeScript with strong types — learn how wasm-bindgen generates .d.ts files, use tsify for complex types, and build type-safe Wasm APIs that feel native to TypeScript consumers.
Multithreading with Wasm
Unlock parallel computation in the browser — learn how SharedArrayBuffer, Web Workers, and wasm-bindgen-rayon bring multithreading to WebAssembly with real speedups.
Wasm + Machine Learning
Run machine learning inference in the browser using Wasm — build matrix operations, implement a neural network forward pass, and learn how Rust Wasm competes with TensorFlow.js.
Regex & Text Processing in Wasm
Harness Rust's blazing-fast regex engine in WebAssembly — validate input, search text, parse logs, process CSV data, and handle Unicode correctly.
Wasm + SVG Manipulation
Generate and manipulate SVG graphics from Rust — compute Bezier curves, build chart paths, optimize SVG output, and create dynamic visualizations powered by Wasm.
Building a Markdown Parser in Wasm
Build a markdown tokenizer and HTML converter in Rust/Wasm — learn about parsing, AST representation, and why Wasm excels at text processing.
Wasm + Compression
Implement client-side data compression algorithms in Rust/Wasm — Run-Length Encoding, LZ77, and Huffman coding fundamentals.
Advanced Cryptography in Wasm
Implement XOR cipher, Caesar cipher, and a Feistel network block cipher in Rust/Wasm — learn the building blocks of modern encryption.
Wasm + PDF Generation
Generate PDF files client-side with Rust/Wasm — learn the PDF file format internals and build a minimal PDF generator from scratch.
SQLite in the Browser via Wasm
Build a simple in-memory SQL engine in Rust/Wasm — learn about SQL parsing, query execution, indexing, and why full databases run in the browser.