REVIEW - Programming Rust, 2nd Edition - Fast, Safe Systems Development

Title:

Programming Rust, 2nd Edition - Fast, Safe Systems Development

Author:

Jim Blandy, Jason Orendorff, Leonora F. S. Tindall

ISBN:

9781492052593

Publisher:

O’Reilly Media (2021)

Pages:

622

Reviewer:

Matthew R. Jones

Reviewed:

March 2022

Rating:

★★★★★

Verdict: Highly Recommended

It should be noted that this reviewer is exactly the target audience for this book: experienced in C, C++, real time systems, bugs, crashes, undefined behaviour, and dodgy pointer casts.

This is an excellent book. It has obviously been written by real software engineers, for real software engineers. I don’t know Rust so I can’t tell exactly how completely the language is explained, but it was certainly detailed and felt thorough. I have no doubt that with this book beside me, and online reference material, I could take on my first Rust project. And many more after because this is not a throw away ‘getting started’ book.

I started out reading every chapter in detail but didn’t have time to work along with a real project, so eventually my head started spinning and I gave up. It is hard to learn a language ‘dry’ so this was entirely my fault, not that of the book! I did work through the first few examples and these worked without any issues: there was enough help to really get working with Rust. This is important because Rust is an ecosystem, not just a stand alone language, and this was explained well.

After ‘A Tour of Rust’ (chapter 2), the book builds up the language features predictably with a chapter per concept. Throughout the book the authors subtly sell the safety features of Rust (implicitly over C/C++), by explaining exactly how the language is implemented and leaving the reader to draw their own conclusion. They don’t labour the point but they are convincing. The flow was smooth and logical with only one tiny fault: as soon as the concept of unsafe code was introduced, it was cross referenced to the penultimate chapter so I had to flip forwards hundreds of pages to satisfy my curiosity. But this is their point: you can do almost everything safely in Rust. Unsafe code is a necessary evil, not a core part of the language, so it is consigned to the end of the book.

In case it is not obvious, it is worth pointing out that this is not a book about systems programming, or about learning programming in general. This book is not for novice programmers. As they say in the preface, “If you're already a systems programmer and you're ready for an alternative to C++, this book is for you.

Website: https://www.oreilly.com/library/view/programming-rust-2nd/9781492052586/