Overview
Syllabus
Intro
The Pitch
Week 3: Explain why it matters
The Plan
What's the approach?
Suggestions: 1. Do examples beforehand 2. Treat rustc as a teacher 3. Don't fake it
Rust Playground The (New) Rust Book Rustlings Godbolt
The Class
All data has an owner Ownership can be moved Old owner can't use data Simple types can be copied
Aliasing XOR Mutability
Emphasize the rules Give lots of examples Show some complex cases
Sometimes you need code that's generic over lifetimes
Assignment: do the move semantics Rustlings exercises
Threads w/out data races
Introduce the key stdlib types: Arc, Rc, Mutex, RwLock
Make clear that Rust stops data races, not race conditions
Assignment: solve the Dining Philosophers problem
Safety & Security
Explain Safe Rust & Unsafe Rust
Unsafe Rust can't trust Safe Rust
Safety lies at the module boundary
Safety has an impact on security
Assignment: find a CVE that could have been stopped by Rust
The Results
Ended the series with a post-Rust survey
And the syntax was weird
Students felt Rust was really powerful
Students felt more confident than they did with C++
The ergonomics initiative will help new Rustaceans!
Conclusion
Taught by
Rust