System Programming in Rust
298 pages
English
PDF
4.5

System Programming in Rust

System Programming in Rust

Author:

Year:

Summary:

Introduction

The book «Systems Programming with Rust» (authors: Jonathan Creekmore and James Miller, 2017, 298 pages) is a practical guide that immerses the reader in the world of systems programming using the Rust language. Unlike many introductory textbooks, this book immediately focuses on real-world low-level development tasks: memory management, working with file descriptors, network interaction, creating C libraries, and interacting with the operating system. Rust, known for its safety without a garbage collector, becomes an ideal tool for writing reliable system software, and the authors demonstrate this in practice.

What the book is about

The book consists of 12 chapters, each dedicated to a specific aspect of systems programming. It begins with a brief overview of Rust basics (ownership, borrowing, lifetimes), but assumes the reader is already familiar with the language syntax. The authors then move on to key topics:

  • Memory management and safety — how Rust guarantees the absence of data races and dangling pointers in system code.
  • Working with file systems and input/output — low-level operations, buffering, asynchronous I/O.
  • Network programming — creating TCP/UDP servers and clients, working with sockets, protocol parsing.
  • FFI (Foreign Function Interface) — calling C functions from Rust and exporting Rust functions for C, creating wrappers over system libraries.
  • Parallelism and concurrency — using threads, channels, mutexes, and async/await (at the time of the book's release — futures).
  • System calls — direct syscall invocation on Linux, working with signals, process management.
  • Embedded systems — writing code for microcontrollers using Rust.

Who this book is for

The book is aimed at programmers already familiar with the basics of Rust (or another systems language, such as C/C++) who want to delve deeper into systems programming. It will be useful for:

  • Developers of operating systems and drivers.
  • Engineers working on network services and high-load systems.
  • Specialists in embedded systems (IoT, microcontrollers).
  • Anyone who wants to understand how Rust is used in real projects beyond web development.

What the reader will learn

After studying the book, the reader will be able to:

  • Write safe system code in Rust without memory leaks and data races.
  • Create efficient network applications from scratch.
  • Integrate Rust code with existing C libraries via FFI.
  • Work with system calls directly, bypassing the standard library (no_std).
  • Understand the internal workings of Rust: how lifetimes, ownership, and borrowing work at the machine code level.
  • Develop applications for embedded platforms such as ARM Cortex-M.

Strengths

One of the main advantages of the book is its practical focus. Each chapter contains code examples that can be immediately run and modified. The authors not only explain theory but show how to solve real problems: for example, how to write an HTTP server from scratch or how to safely handle a SIGINT signal. The book also pays attention to performance: optimizations, profiling, and writing zero-cost abstractions are discussed. Another plus is the emphasis on safety: the authors explain in detail how Rust prevents entire classes of vulnerabilities typical for C/C++.

Despite the fact that the book was published in 2017 (and some examples may use outdated versions of crates), the core concepts remain relevant. Rust is a stable language, and the fundamental principles of systems programming

Recommendations