Preface
This book serves as the script for the lecture 'Advanced Systems Programming' taught at the University of Applied Sciences in Darmstadt. 'Advanced Systems Programming' is part of the curriculum of the computer science bachelor degree course. It is aimed at undergrad students in their last couple of semesters and is an optional course. Prerequisites are the basic 'Introduction to Programming' courses (PAD1&2) as well as the introductory course on operating systems (Betriebssysteme).
What is Advanced Systems Programming about?
The main focus of the Advanced Systems Programming course and this book is to teach you how to develop systems software using a modern programming language (Rust). Within this course, you will learn the basics of what systems programming is with many hands-on examples and exercises to get them familiar with the modern systems programming language Rust. You are expected to have basic knowledge of C++, so one of the cornerstones of this course is the continuous comparison of common aspects of systems software in the C++-World and the Rust-World. These aspects include:
- Data (memory and files, ownership)
- Runtime performance (zero-overhead abstractions, what makes C++ & Rust fast or slow?)
- Error Handling
- Communication between processes and applications
- Concurrency as a basic building block of systems software
- The development ecosystem, specifically Rust's
cargo
and how it unifies compilation, deployment, configuration, testing, benchmarking etc.
For students taking the ASP course, hands-on experience with these topics is gained in the extended lab part, where they will implement the learned aspects within real systems software. In the first part of the lab, this is done through a series of exercises, which include translating concepts from C++ code to the Rust world and extending small programs with new features. The second part of the lab will be a larger project in which students will implement a system of their choice (for example a web-server, game-engine, or a compiler for a scripting language) using the concepts that they have learned in this course. All lab sessions will also include a small analysis of an existing piece of (open-source) software. This way, students will familiarize themselves with reading foreign code and will get experience from real-world code.
What is Advanced Systems Programming not about?
Systems programming is a very large discipline that covers areas from all over the computer science field. As such, many of the concepts that you will learn and use in this course might warrant a course on their own (and sometimes already have a course on their own). As such, Advanced Systems Programming is not a course that goes into the cutting edge research of how to write blazing fast code on a supercomputer or writing an operating system from scratch. While this course does cover many details that are relevant to systems programming, it is much more focused on the big picture than a deep-dive into high-performance software.
Additionally, while this course uses Rust as its main programming language, it will not cover all features that Rust has to offer, nor will it teach all Rust concepts from the ground up in isolation. Rust is well known for its outstanding documentation and you are expected to use this documentation, in particular the Rust book, to extend your knowledge of Rust beyond what is covered in this course. This course also is not a tutorial on how to use Rust. You will learn systems programming using Rust, but Rust as a general-purpose language has many more areas of application than just systems programming. A lot of focus on the practical aspects of using the Rust language will be put in the lab part of this course, as it is the authors firm believe that one learns programming by doing, and not so much by reading.
How to use this book?
This book is meant to be used as the backing material for the lecture series. In principle, all information covered in the lectures can be found within this book (disregarding spontaneous disussions and questions that might arise during a lecture). Depending on your learning style, this book can serve as a reference for the things discussed in the lecture, or can be used for self-study. It does not replace participation in the lab part of the course. Gaining hands-on experience is at the core of this lecture series, so attendence of the lab is mandatory.
Besides a lot of text, throughout this book you will find several exercises, which range from conceptual questions to small programming tasks. These exercises are meant to recap the learned material and sometimes to do some further research on your own. With an exception to the open-ended questions, all exercises do provide solutions hidden behind a collapsible UI element, like so:
Additionally, this book contains many code examples, which look like this:
fn main() { println!("Hello Rust"); }
Whenever applicable, you can run the code example using the play button on the top-right of the code panel. Rust code is run using the Rust playground.
Supplementary material
This book comes with lots of code examples throughout the text. In addition, the following text-books are a good start for diving into the concepts taught in this course:
- Bryant, Randal E., O'Hallaron David Richard, and O'Hallaron David Richard. Computer systems: a programmer's perspective. Vol. 2. Upper Saddle River: Prentice Hall, 2003. {{#cite Bryant03}}
- Klabnik, Steve, and Carol Nichols. The Rust Programming Language (Covers Rust 2018). No Starch Press, 2019. {{#cite Klabnik19}}
- Also available online: https://doc.rust-lang.org/book/
- Stroustrup, Bjarne. "The C++ programming language." (2013). {{#cite Stroustrup00}}
An comprehensive list of references can be found at the end of this book.