The Rust programming language

Motivation

The ability to read and write multiple programming languages is a requirement for computer scientists.

Most languages have a tradeoff between speed of execution and safety. For instance, Python makes it easy to write slow, correct programs, while programs written in C are usually very fast, but it is tough to make them correct. As a result, the C language, while being easy to learn, takes years to master.

The Rust programming language is a language that aims to 1/ be accessible to everyone, 2/ prevent programmers from writing whole classes types of bugs, and 3/ let programmers write efficient code.

Course description

This course is an introduction to the Rust programming language. We will start by learning some basic concepts (branches, loops, functions, structures, references, interfaces, etc.) and some parts of the standard library (strings, vectors, options, macros, I/O, multithreading, etc.). The design adopted by other languages and their associated tradeoffs are discussed.

A special focus is put on the readability and reuseability of the code.

Objectives

After completing this course, students will be able to:

  • understand the structure, syntax, and semantics of the Rust programming language
  • understand the design choices made in Rust and their associated tradeoff
  • use parts of the standard library, as well as some other pervasive libraries
  • design, implement, and test a Rust program to solve real-life problems

Schedule

Date Topic Ressources Exercises
09.04.2025 Intro to Rust slides Installation sheet
09.04.2025 Variables main.txt Exercise sheet
17.04.2025 More syntax: control flow, function syntax.pdf Exercise sheet
17.04.2025 First look at ownership ownership.pdf (see above)
17.04.2025 Splitting code into modules code (see above)

Resources

Learning Rust

Rust website

IDE used in class

You do not have to use a specific IDE. But if you use the same as me I might be able to help you a bit.

I recommend using the following extensions:

I also recommend:

  • turning on “format on save”
  • using clippy for better lints (“rust-analyzer.check.command”: “clippy””)

Operating system used

You do not have to use a specific OS. But if you use the same as me I might be able to help you a bit.

Optimizations