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
THE HORIZON

Where this sits, and what moves it.

Binding constraint · The cost of a guarantee at runtime. A garbage collector buys memory safety with a pause you cannot schedule around; ownership buys the same safety at compile time and charges nothing at run time.

Was impossible

Writing a control loop meant choosing between safety and determinism. C gave you the timing and none of the guarantees; a managed language gave you the guarantees and a collector that could stop the loop at the worst possible moment.

Is probable

Rust removes that trade, and this course makes the removal visible by having the borrow checker reject a bug before a robot could act on it. What is not removed is the human cost: the model has to be learned, and a field that has written embedded C for forty years does not re-tool quickly.

Becomes possible

The direction to watch is one binary spanning simulation and the device with nothing conditional in between -- which this course already does, browser to microcontroller. What would make it decisive is the same source carrying a machine-checkable timing proof, so 'correct' and 'correct on time' stop being separate claims.

Every hard thing was impossible until the constraint that made it impossible was named. How we read a frontier →

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 CostYou write drive() generically so it runs ANY Controller (Pursuit now, others later). In Rust, what does that abstraction cost at runtime?Define 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.
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 →