Logo ČVUT
ČESKÉ VYSOKÉ UČENÍ TECHNICKÉ V PRAZE
STUDIJNÍ PLÁNY
2026/2027

Safe Systems Programming in Rust

Zobrazit rozvrh
Kód Zakončení Kredity (ECTS) Rozsah Jazyk výuky
FITE-REZ Z,ZK 5 2P+1C anglicky
Garant předmětu:
Filip Křikava
Přednášející:
Pierre Donat-Bouillud, Filip Křikava
Cvičící:
Matej Almáši, Filip Křikava, Dávid Marek Manca
Předmět zajišťuje:
katedra teoretické informatiky
Anotace:

Systems programming requires efficient, predictable, and safe code. Rust addresses common memory-safety and concurrency errors through an expressive, statically checked type system, while providing fine-grained control over performance.

The course begins with Rust fundamentals, focusing on how its type system enables memory safety without garbage collection and supports zero-cost abstractions. We explore memory management, type-safe error handling, polymorphism, and techniques for building reliable and efficient software.

Next, we focus on concurrent, parallel, and asynchronous programming, examining how Rust prevents data races at compile time, how different concurrency models work, and where Rust's safety guarantees have limitations.

Finally, we introduce unsafe Rust and interoperability with C and C++ exploring how to maintain safety when the compiler can no longer enforce it.

During the semester students will work on two small projects.

Požadavky:

Start requirements:

Knowledge of C and C++ at the level of PA1/PA2.

Osnova přednášek:

L1. Memory and concurrency in systems programming

L2. Ownership and borrowing

L3. Lifetimes

L4. Data types, collections, and error handling

L5. Traits and generics

L6. Smart pointers, I/O, and macros

L7. Closures and iterators

L8. Threads and thread safety

L9. Atomics, parallelism and memory ordering

L10. Asynchronous programming: models and futures

L11. Asynchronous programming: runtimes

L12. Unsafe Rust and FFI

L13. Backup (a guest lecture or catch-up or a lecture on no-std Rust)

Osnova cvičení:

The six labs are in class, on computers for hand-on coding sessions, possibly AI assisted, not AI prompted. Before each lab, students make sure they are familiar with the specified chapters of the recommended literature and work through quizzes based on those chapters. The content of the lab will then be a series of exercises related to that content. Students terminating early can then follow working on semestral projects.

Labs must be scheduled after lectures.

Lab 1:

Rust basics and tools, modules, tests

Reading: Brown Ch 13

Students install and configure the toolchain and the editor support. Introduction to cargo and series of basic Rust exercises, including modules and tests.

Lab 2:

Ownership, lifetimes, data types, and errors

Reading: Brown Ch 4, 5, 6, 8.18.2, 9

Students correct programs that the borrow checker rejects. For each program, they decide if the program was unsafe and why, or if it was safe but outside the limits of the checker. Practice using lifetimes.

Lab 3:

Traits, generics, I/O, smart pointers

Reading: Brown Ch 7, 10, 11, 15.1, 18.2; Ch 12 (optional)

Students write a command-line utility, and furthermore:

learn static and dynamic dispatch,

work with I/O in Rust,

utilize Traits to properly define code behavior,

work with smart pointers, such as Box.

Lab 4:

Threads and synchronization

Reading: Brown Ch 13, 15, 16

Students exercise tasks in parallelism and synchronizing threads, including focus on data race safety in Rust.

Lab 5:

Async in practice

Reading: Brown Ch 17; Ch 21 (optional)

Students will dive into the following topics:

exercises on async,

async executors, tokio,

working with async functions,

'static lifetime requirements,

smart pointer applications in async context.

Lab 6:

Unsafe Rust and FFI

Reading: Brown Ch 20.1 + some interesting part from the unsafe rust book?

The final lab will be focused on low-level operations with raw pointers, calling C/C++ code - interacting with a library, using embassy and writing low level hardware code and examples in practice

Cíle studia:

The objective of this course is to understand the challenges of systems programming, particularly the memory-safety and concurrency errors that can lead to crashes, undefined behavior, and security vulnerabilities. We examine why these problems arise, how traditional systems programming languages address them, and how language design and type systems can prevent many of them without sacrificing performance. The course focuses on safe systems programming, using Rust as a practical vehicle to explore its principles. Students will learn how Rust's safety guarantees work, what their limitations are, and how to write efficient, reliable systems software with predictable performance.

By the end of the course, students will be able to tell when rewrite it in Rust is the right answer and when it isnt.

Studijní materiály:

Main resource is Programming in Rust, Brown Edition (https://rust-book.cs.brown.edu/)

Additional resources include:

- The Rust Programming Language (ISBN: 1718504446)

- Rust Atomics and Locks (ISBN: 9781098119447)

- Programming Rust, 2nd revised edition (ISBN: 9781492052586)

Poznámka:

Information about the course and courseware are available at https://courses.fit.cvut.cz/FITE-SPR

Další informace:
https://courses.fit.cvut.cz/FITE-REZ
Rozvrh na zimní semestr 2026/2027:
Rozvrh není připraven
Rozvrh na letní semestr 2026/2027:
Rozvrh není připraven
Předmět je součástí následujících studijních plánů:
Platnost dat k 19. 11. 2026
Aktualizace výše uvedených informací naleznete na adrese https://bilakniha.cvut.cz/cs/predmet8908906.html