Week 10: Soul of Rust

Introduction

This week starts with why memory cleanup is hard, how Python handles it for you, and the difference between the stack and the heap. Then we will follow small Rust programs to see who owns a value, what happens when it moves, and how a function can borrow it to read or change it. We’ll predict outputs, read compiler diagnostics, and make one change at a time. The main lesson covers ownership, borrowing, string slices, and keeping borrowed data valid; named lifetime annotations are an optional extension.

Lectures

Lab assignment