Programming in Rust
622 pages
English
PDF
4.5

Programming in Rust

Programming in Rust

Author:

Year:

Summary:

Introduction

The book "Programming Rust" (first edition, 2017) by authors Jim Blandy and Jason Orendorff is one of the most authoritative and in-depth guides to the Rust language, released in the early years after the language's stabilization. Despite the fact that several years have passed since its release and a second edition (2021) has been published, the first edition remains a valuable resource for anyone who wants to understand the fundamental principles of Rust, its philosophy, and the features of systems programming. The book is published in hardcover, contains 622 pages, and covers both basic and advanced topics.

What This Book Is About

"Programming Rust" is not just a syntax reference. It is a comprehensive tutorial that sequentially introduces the reader to the language, starting with tool installation and ending with complex concepts such as ownership, borrowing, lifetimes, closures, iterators, multithreading, and unsafe code. The book is structured to give the reader not only knowledge but also an understanding of why Rust is designed the way it is. Special attention is paid to the type system and memory model — the key differences between Rust and C++ and other systems languages.

Who This Book Is For

The book is aimed at programmers who already have experience with other languages (C, C++, Python, Java, Go). It may seem difficult for programming beginners, but for those who want to transition to Rust from other languages, it is an ideal starting point. The authors assume the reader is familiar with basic concepts: pointers, stack, heap, compilation, data types. If you already write in Rust but want to deepen your understanding of its internal workings, this book will also be useful.

What the Reader Will Learn

  • Basics of Rust syntax and semantics: variables, functions, structs, enums, pattern matching.
  • The ownership system, borrowing, and lifetimes: key concepts that ensure memory safety without a garbage collector.
  • Working with types: generic programming (generics), traits, dispatch, static and dynamic binding.
  • Closures and iterators: Rust's functional capabilities and their efficient use.
  • Memory management: Box, Rc, Arc, RefCell, Cell — smart pointers and interior mutability.
  • Multithreading and concurrency: Send, Sync, mutexes, channels, atomic operations.
  • Unsafe Rust: when and how to use unsafe code, working with raw pointers, FFI (interfacing with C).
  • Macros: declarative and procedural macros, creating them.
  • Testing and documentation: built-in testing tools, writing documentation.

Strengths of the Book

The first thing that stands out is the clarity and structured presentation. The authors do not just list facts but explain the logic of the language. For example, the chapter on ownership and borrowing is written so clearly that even complex concepts become understandable. Second, there are many practical examples. Each topic is accompanied by small but complete programs that can be run and experimented with immediately. Third, there is depth. The book is not afraid to delve into the details: topics such as the internal structure of Vec, how the allocator works, and the memory model are covered. This allows the reader not just to use Rust but to understand what is happening "under the hood." Finally, the quality of the translation (speaking of the Russian-language edition) is excellent; the terminology is consistent and conforms to established norms.

Who It Is Recommended For

The book will be useful for:

  • C/C++ developers who want to switch to a safer but equally performant language.
  • Programmers in Python, Java, Go,

Recommendations