Week 13: Macros
Slides:
light (pdf), dark (pdf)
Homework: Final project season!
Lecture:
- Declarative Macros
- Proc Macros
Extra Material: - Rust Book 19.5
- Rust Macros Reference
- The Little Book of Rust Macros
Week 12: Concurrency
Slides:
light (pdf), dark (pdf)
Homework: Final project season!
Lecture:
async
/await
- Futures
- Polling
Extra Material: - Async Book
Week 11: Parallelism
Slides:
light (pdf), dark (pdf)
Homework: Final project season!
Lecture:
- Threads
- Synchronization
- Message Passing
Send
andSync
- More Synchronization
Extra Material: - Rust Book Chapter 16
- Rustonomicon Chapter 8
Week 10: Smart Pointers and Unsafe
Slides:
light (pdf), dark (pdf)
Homework: Final project season!
Lecture:
- The Rc
Type - The RefCell
Type - Memory Leaks
- Unsafe Superpowers
- Raw Pointers
- FFI
Week 9: Box and Trait Objects
Slides:
light (pdf), dark (pdf)
Homework: Final project season!
Lecture:
- The
Box<T>
Type - The
Deref
Trait and Deref Coercion - The
Drop
Trait andstd::mem::drop
- Object-Oriented Programming
- Trait Objects
- Dynamic dispatch with
dyn
- Dynamic dispatch with
- Dynamically Sized Types
Week 8: Lifetimes
Slides:
light (pdf), dark (pdf)
Homework: (on Gradescope)
Lecture:
- Lifetimes Intro and Motivation
- Lifetime Annotations
- Lifetime Elision
- Lifetimes as Generics and Bounds
- 'static Lifetimes
- What is
'a
lifetime video?
Week 7: Crates, Closures, and Iterators
Slides:
light (pdf), dark (pdf)
Lecture:
- Crate Highlights
rand
clap
anyhow
tracing
flamegraph
- Closures
- Fn Traits
- Iterators
- Loops vs. Iterators
Extra Material:
- Rust Book Chapters 13 and 14
Week 6: Modules and Testing
Slides:
light (pdf), dark (pdf)
Lecture:
- Module System
- Packages and Crates
- Modules
- Using Modules
- Paths
- Misc
- Testing
- Simple Testing
- Controlled Testing
- Test Organization
Extra Material:
- Rust Book Chapters 7, 11, and 14
Week 5: Error Handling and Traits
Slides:
light (pdf), dark (pdf)
Agenda:
- Type Aliases
- Const Generics
- Error Handling
panic!
Result<V,E>
- The Never Type
- Traits
- Trait Bounds
Copy
vsClone
- Supertraits
- Derivable Traits
Extra Material:
- Rust Book Chapter 10.1 and 10.2
Week 4: Standard Collections and Generics
Slides:
light (pdf), dark (pdf)
Agenda:
- Vectors
Vec<T>
API- Ownership and Borrowing
- Strings
- UTF-8
String
API
- Maps
- Focus on
HashMap
andHashSet
Entry
API
- Focus on
- Generics
- Functions
- Structs and Enums
impl
Blocks- Monomorphization
Extra Material:
- Rust Book Chapters 8 and 10.1
Week 3: Structs and Enums
Slides:
light (pdf), dark (pdf)
Homework: (handout, writeup)
Agenda:
- Ownership Review
- Structs
- Creating Structs
- Update syntax
- Tuple Structs
- Unit Structs
- Lifetimes sneak peek
- Creating Structs
impl
Structs and Methods- Automatic referencing and dereferencing
Self
vs&self
- Associated functions
- Enum basics
- Pattern Matching
- Option Type
if let
Extra Material:
- Rust Book Chapters 5 and 6
Week 2: Ownership
Slides:
light (pdf), dark (pdf)
Homework: (handout, writeup)
Agenda:
- Ownership
- Announcements and Review
- Ownership Rules
- Memory and Allocation
String
Type and AliasingCopy
andClone
Traits- Ownership with Functions and Return Values
- References and Borrowing
- Reference Vs Ownership
- Immutable and Mutable References
- Dangling References and Data Races
- Slices
- Memory Layout
&str
Vec
- Memory Layout
Extra Material:
Week 1: Introduction
Slides:
light (pdf), dark (pdf)
Homework: (handout, writeup)
Agenda:
- Why Rust?
- Cargo Basics
- Syntax
- Variables and Mutability
- Data Types
- Scalar Types
- Compound Types
- Functions, Statements, and Expressions
- Control Flow
- Course Logistics
- Installing Rust
Extra Material
- Rust Book Chapters 1-3
rustlings
exercisesvariables
functions
if
primitive_types