PAI-140 · Education

Rust for Physical AI

A language, not a syntax tour. You learn Rust by writing the firmware that drives a 3D rover: every lesson compiles real no_std Rust to WebAssembly and runs it as the live control loop. When the borrow checker rejects a bug, you watch it reject the bug before the robot could ever make it. Ownership and memory safety without a garbage collector, the type system as a modelling tool, zero-cost abstraction, and the one-binary seam from browser sim to bare metal — the substrate (Ferric) that makes the boundary the robot's own, on-device, no cloud: the reasons Physical AI is being written in Rust.

Intermediate → Skilled·5 modules·8 lessons
▶ Start the course ← All courses
Module 3

Abstraction at Zero Cost

Build a reusable controller with a struct, a trait, and a generic function, and understand why Rust's abstractions compile down to the same tight code as hand-written math, the property that lets one policy run on a microcontroller.

  1. L4Traits: Reusable Control, Zero CostDefine a Controller trait, implement it on a Pursuit struct, and call it through a generic function, seeing that the abstraction adds no runtime overhead on the metal.
Module 4

One Binary, Sim to Edge

Understand why the same Rust source compiles unchanged to both this browser (WebAssembly) and a real microcontroller, and where the real boundary between portable logic and hardware sits.

  1. L4One Source, Two TargetsWrite the portable control core and understand the seam: the same control() that compiles to WebAssembly here also cross-compiles to a Cortex-M or RISC-V target, with only the HAL changing.
See it live

Anatomy demonstrations

The machines behind this course, taken apart three ways — the body, the one rule, and the small learned brain. Guess before you look; an open core proves every number on the page.

DemonstrationAnatomy of DrivingNonholonomic control, live →The whole series →
Foundations

From the interactive textbook

The ideas under this course as live explorables — each runs the real Rust library and re-derives its own result.

Ch. 3 · SafetyThe command it will not obeyOpen the chapter ↗The full textbook →