Schedule

Week 13: Macros

Slides:
light (pdf), dark (pdf)

Homework: Final project season!

Lecture:

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 and Sync
  • 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 and std::mem::drop
  • Object-Oriented Programming
  • Trait Objects
    • Dynamic dispatch with dyn
  • 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)

Homework: (handout, writeup)

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)

Homework: (handout, writeup)

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)

Homework: (handout, writeup)

Agenda:

  • Type Aliases
  • Const Generics
  • Error Handling
    • panic!
    • Result<V,E>
  • The Never Type
  • Traits
    • Trait Bounds
    • Copy vs Clone
    • Supertraits
    • Derivable Traits

Extra Material:

  • Rust Book Chapter 10.1 and 10.2

Week 4: Standard Collections and Generics

Slides:
light (pdf), dark (pdf)

Homework: (handout, writeup)

Agenda:

  • Vectors
    • Vec<T> API
    • Ownership and Borrowing
  • Strings
    • UTF-8
    • String API
  • Maps
    • Focus on HashMap and HashSet
    • Entry API
  • 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
  • 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 Aliasing
    • Copy and Clone 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