---
# System prepended metadata

title: 'Option 1: Rust Compiler Hacks for Greater Good'

---

# Option 1: Rust Compiler Hacks for Greater Good
Rust is a modern systems programming language focusing on safety, performance, and concurrency.
Rust's strict enforcement of type and ownership rules allows the compiler to give strong safety guarantees but poses a challenge for new programmers who are used to more liberal compilers.
Nonetheless, Rust is frequently considered one of the most beloved programming languages.

**Morale:** Rust programmers generally accept trading a bit more annotation effort (e.g., lifetimes) for correctness guarantees.

The overall goal of this course is to build upon the above observation and explore methodologies that aim at increasing the trustworthiness of Rust programs. To this end, we will use Rust's meta-programming capabilities to add specifications to various Rust constructs. We will then implement and evaluate small Rust compiler plugins that take these specifications and apply existing techniques for finding bugs or proving their absence, such as

- design-by-contract (https://github.com/nrc/libhoare, https://crates.io/crates/contracts),
- fuzzy testing (https://crates.io/crates/bolero),
- property testing (https://crates.io/crates/proptest),
- automated verification (https://github.com/viperproject/prusti-dev, https://github.com/xldenis/creusot), or
- other techniques that give insights into the code base unrelated to testing and verification (e.g., small analyses determining how much code depends on unsafe Rust).

## Structure of the course:
The first week will consist of lectures and exercises with the following content:

- A brief introduction to Rust programming such that we start on the same level; this won't replace doing a Rust tutorial yourself, though.
- A closer look at Rust meta-programming, i.e., declarative and procedural macros.
- An overview of how the Rust compiler works; we will also implement a small compiler plugin together, for example, one implementing design-by-contract.
- A discussion of testing and verification methodologies with existing Rust implementations (see above).

The remaining two weeks will consist of small-group projects in which we extend our compiler plugin to cover more techniques (e.g., derive code for protest from user-written specifications) or add more powerful specification syntax. Ideally, we will find a nice way to write Rust annotations that can then be used by existing testing and verification frameworks.

Since this is a special course, the outcome of the projects is a bit more open than for a regular course (i.e., you do not have to worry that this may be too much for three weeks :))

# Option 2: Rust Oberseminar

A somewhat more theoretical option would be to have a seminar on the concepts of Rust programming. In this setting, every participant picks a research paper concerned with Rust, studies it in detail, writes a report, and gives an in-depth presentation to all other participants.

I would be available for discussions throughout the preparation time and try to help you with the papers where possible, but this course requires a significant amount of self-study. However, it also allows us to cover many different topics instead of focusing on one project.

Naturally, I could recommend some research papers on Rust verification, but I would also be open to other topics related to Rust programming