Lecture Notes

Here you can find the lecture notes for each Lecture, they might also contain extra information that is not talked about in the lecture. Below you can find links to each of the notes, together with a very brief course summary.

  • Lecture 1: Intro to Rust (and basics); In this lecture we start up the course, compare Rust to some alternatives and talk about the basics of programming in the language and in general. We will briefly cover a few basics such as loops, conditionals, and some datatypes.
    • Lecture 1.5 (Lab 1): Git; Since the course has just started, we will use the first lab session to talk about Git. This has little to do with the rest of the lectures, but is vital to program in teams. You will use Git extensively in the group project later in this course, and right now already for other courses like Advanced Computing Systems. That is why we cover Git already so early in the course.
  • Lecture 2: References and Ownership; In this lecture we talk about what rust calls "Ownership". We will discuss what references are, and how they relate to ownership, something that is called borrowing. We also look at so-called "Sized" types and unsized types. We may finish the in-person lecture with a discussion on string types in Rust and on unicode.

  • Lecture 3: Types and Memory; In this lecture we talk about data types, and how they can describe memory. We cover the primitive data types such as numbers, and some simple compound data types such as Vec as well as how to create your own data types.

  • Lecture 4: Enumeration Types; In this lecture we cover what enum data types are and their difference to structs. Note that enums in Rust are quite different from those in other languages! We will also discuss error handling using the Result type and optional data with the Option type.

    • Lecture 4.5 (Lab 4): Errors; An extension to Lecture 4, where we live-code an application which can produce errors, and we see how we handle this. This page shows the code we wrote during this lecture.

  • Lecture 5: Iterators and Collections; In this lecture we talk about several more standard collections: HashMap and HashSet. Then we go into what Iterators are: how they interact with for loops, and how we can iterate over various collections. The ones discussed in this lecture, but also Vec and String.

  • Lecture 6: Traits and Generics; In this lecture we will discuss generics. We already saw them very briefly during the last lecture. We talk about generic data types and generic code (functions), and how types can be bounded by so-called traits: properties of types. If time permits, we will finish with types and functions which are generic over a lifetime.


  • Lecture 7: Testing and Tooling; In this lecture we will talk about testing code, both while coding and to build confidence that code is correct when done coding. We will also discuss some static analysis tools which can help when writing code: clippy and rustfmt.

  • Lecture 8: Modules, Crates, and the group Project; In this final lecture we talk about how modules and crates work. During the individual assignment you may have already interacted with them but you might not have figured out how they work completely. We will also talk about cargo rust's package manager and about the libraries available on crates.io.


After week 4, there will be no more lectures and thus no more lecture notes. Instead, you will work on a group project which you can find information about here