Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
A Tale of Teaching Rust
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Andrew Lilley Brinker
April 10, 2025
Programming
74
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
A Tale of Teaching Rust
Andrew Lilley Brinker
April 10, 2025
Transcript
85 slides
A Tale of Teaching Rust Andrew Brinker
Hi! I’m Andrew!
I’m here to tell you a story
Act 1: The Idea
In early 2017, I was asked to teach a class
on programming languages
I replaced C with Rust, because it’s 2017
10 weeks long. Enough time for Rust, right?
Normally: Lisp, C, Java, Prolog Me: Haskell, Rust, Java, Prolog
3 weeks for Rust. No time to teach it all!
Act 2: The Pitch
What is Rust’s elevator pitch?
Zero-cost abstractions Move semantics Guaranteed memory safety (without GC) Threads
without data races Trait-based generics Type inference Minimal runtime Optional unsafety And more!
Zero-cost abstractions Move semantics Guaranteed memory safety (without GC) Threads
without data races Trait-based generics Type inference Minimal runtime Optional unsafety And more!
Week 1: Safety without GC = Ownership + borrows
+ lifetimes
Week 2: Threads without data races = Week 1
+ Send + Sync
Week 3: Explain why it matters
Act 3: The Plan
26 upper-division undergrads Wide variety of backgrounds None knew Rust
going in Some heard Rust was hard
What’s the approach?
Be very concrete: Lots of examples Live coding
Potential challenge: this requires the teacher to know Rust well
Suggestions: 1. Do examples beforehand 2. Treat rustc as a
teacher 3. Don’t fake it
Know the ecosystem of tools
Rust Playground The (New) Rust Book Rustlings ❤ Godbolt
Give room & tools to explore
Act 4: The Class
Lab 1: Safety without GC
All data has an owner Ownership can be moved Old
owner can’t use data Simple types can be copied
Students will realize this is painful to work around
Then introduce borrows
Aliasing XOR Mutability
Emphasize the rules Give lots of examples Show some complex
cases
Students will ask how it works
Then introduce lifetimes
Be very explicit: lifetimes are scopes, and all borrows have
one
The compiler tracks them whether they’re explicit or not
You can’t assign a lifetime
Sometimes you need code that’s generic over lifetimes
That’s when you make lifetimes explicit
If you have time (I didn’t), introduce Cell & RefCell
Assignment: do the move semantics Rustlings exercises
Lab 2: Threads w/out data races
Start with de fi nitions
Concurrency: Multiple threads of control Parallelism: Multiple threads of control,
running at once Deadlock: All threads are stopped (dead) Livelock: Threads are live, but not progressing Data race: Non-syncing mutable data across threads Race condition: Result depends on execution order And so on…
Same as before, be concrete
Talk about Send and Sync
Explain why some types implement them, and some don’t
Don’t explain unsafe traits (yet)
Introduce the key stdlib types: Arc, Rc, Mutex, RwLock
Explain why Arc is Sync but Rc isn’t
Make clear that Rust stops data races, not race conditions
Easy parallelism is the best! Show it off! Rayon, Hyper
w/ Tokio, Crossbeam
Assignment: solve the Dining Philosophers problem
Lab 3: Safety & Security
Bold move: Introduce unsafe
Explain Safe Rust & Unsafe Rust
Unsafe functions + unsafe traits: Have requirements the compiler can’t
check The programmer has to check instead
Unsafe blocks + unsafe trait impls: Tell the compiler “I’ve
checked these!” The compiler assumes you did so correctly
Safe Rust must trust Unsafe Rust
Unsafe Rust can’t trust Safe Rust
Safety lies at the module boundary
Safety has an impact on security
Embedded environments often can’t tolerate GC
Lots of old code in C and C++
Lots of common vulns still being written
Assignment: fi nd a CVE that could have been stopped
by Rust
Act 5: The Results
Ended the series with a post-Rust survey
Here’s what my students said:
Students thought the compiler was too picky
And the syntax was weird
A couple said they only liked Rust in comparison to
Haskell, which was too weird
Don’t despair!
Most students wanted to try Rust some more!
Students felt Rust was really powerful
Students felt more con fi dent than they did with
C++
And there are more reasons for optimism
The ergonomics initiative will help new Rustaceans!
Students did way better with ownership, borrowing, and lifetimes than
expected!
Conclusion
Can Rust be taught in 3 weeks? Not quite, but
you can get students excited for more!
Can Rust be taught to newer programmers? You bet!
Can Rust overcome the bad press on its learning curve?
I sure think so!
Thank you very much!
Twitter: @AndrewBrinker Github: @AndrewBrinker Class site: proglangs.com My site: andrewbrinker.com
More Decks by Andrew Lilley Brinker
See All by Andrew Lilley Brinker
Memory Safety and the Future of Vulnerabilities
alilleybrinker
0
97
Hello and Welcome: Documentation in the Rust Ecosystem
alilleybrinker
0
54
Efficient Nimber Calculation in Dots and Boxes
alilleybrinker
0
150
Other Decks in Programming
See All in Programming
複数ドメインを一つのアプリに統合するFlutterの設計と運用_FlutterKaigi2026登壇資料(須永高弘)
takahirosunaga
0
210
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
610
AIエージェントの「テストは通るのに本番で壊れる」を減らす
shibuiwilliam
3
120
テストだけで見つかる? Rubyでつくるメソッド発掘器
izawa
0
160
Crash Auto Pipelines
veronikapj
1
450
Proxmox x Talos Linux x Terraform で実現するなんかいい感じの Kubernetes クラスタ / A Sleek Kubernetes Cluster Powered by Proxmox, Talos Linux, and Terraform
nnaka2992
0
310
作れるエンジニアから、価値を届けるエンジニアへ
ryunakayama
1
860
数行の変更でDockerビルドを最大91%高速化~GitLab CIの実行基盤を社内40リポジトリに展開するまで~
picopico
3
380
Secure Your Coding Agent Like It’s Malware (v1.5) 🇬🇧 @Code.talks 2026
richargh
0
200
JavaScriptはシングルバイナリの夢を見るか / Does JavaScript Dream of a Single Binary?
ssssota
0
190
Distance field of Julia set
kinakomoti321
0
330
[Kotlin Fest 2026] eBPF Tracing for Kotlin
takehaya
1
400
Featured
See All Featured
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
630
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.5k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
310
Discover your Explorer Soul
emna__ayadi
2
1.3k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
860
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
410
Technical Leadership for Architectural Decision Making
baasie
4
660
Navigating Team Friction
lara
192
16k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Optimising Largest Contentful Paint
csswizardry
37
4k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
70
69k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k