Labs: time not scheduled, room not assigned (Pavel Šimerda, Lukáš Hozda)
Page in SIS: NPRG082
Grading: Credit
About
In this optional course we explore how Rust works and what value it brings to the world of programming languages. We start with ownership, borrowing and we discuss how the borrow checker ensures that Rust programs do not suffer from use-after-free and related bugs. Then we go through additional safety techniques and introduce the notion of values, objects and polymorphism. At the end of the course we look at the crown jewel of Rust which is fear-less parallelism and we explore asynchronous programming with a multi-threaded coroutine scheduler.
This course runs since 2024/25 and extends the original PRG073 course we introduced back in 2021/22 with a dedicated lab for each of the six lectures. We invite you to continue your Rust journey with the follow-up course Advanced Programming in Rust.
Schedule
| Date | Content | Downloads |
|---|---|---|
| Getting Started Discovering Rust's position among other programming languages. How variables, values and assigment work. What is easy in Rust and what is difficult. Using vectors and strings for basic data manipulation. How ownership and move work with local variables and function arguments. Safe borrowing via immutable and mutable references. Using Cargo for Rust projects. |
||
| Lab |
||
| Data Structures Using enumerations and pattern matching for safer and more convenient data modelling. Working with fixed-size data structures like arrays and tuples. Creating custom structures. Using options to allow missing values in structures and return types. Using results for error handling. |
||
| Lab |
||
| Object Lifecycle Creating objects using associated functions. Using the builder pattern to handle defaults and optional configuration parameters. Adding the Copy and Clone traits to structures to handle copying. Using the move semantics as an advantage rather than an obstacle. Heap allocation by boxing values and slices. Storing references with lifetimes inside structures. |
||
| Lab |
||
| Polymorphic types Using traits to introduce generic programming. Specifying trait bounds and using them in functions and methods and combining them with lifetime bounds. Using enumerations for polymorhpic storage. Using references and smart pointers with dynamic dispatch through fat pointers. Keeping traits object-safe to support polymorphic objects. |
||
| Lab |
||
| Multithreading Handling concurrency issues introduced by for-loops. Starting additional threads. Passing and sharing data between threads and the Send and Sync auto-traits. Understanding the concept of fear-less concurrency. Using standard library thread synchronization tools and following the best practices. |
||
| Lab |
||
| Asynchronous Code Using asynchronous blocks and asynchronous functions as the mechanism to describe event-driven programs and running I/O concurrently. Experimenting with a coroutine library in both both single-threaded and multi-threaded environemnts and starting tasks managed by the coroutine task scheduler. |
||
| Lab |
||
|
Wrapping up the course and discussing solutions to home works
and real-world projects. Opportunity to discuss Rust
fundamentals in a broader perspective.
|
For the labs, we advise you to bring your own device where you can do the labs in Rust.
Grading
Not yet decided.
Contact
We meet on Discord:
You can also contact us individually:
- Lukáš Hozda – main contact for 2026/2027
- Pavel Šimerda – course website contents, Rust community
- Petr Tůma – when you can’t reach us
Community Events
Follow Rust events in Czech Republic: