Vitaly Reads: #3, August 2025

Technical Book Reviews

Read to the end to figure out what I was busy with all these months since the previous post.

Refactoring to Rust, Lily Mara and Joel Holmes, Manning Publications, 2025

I’ve just completed reading an amazingly well-written book called “Refactoring to Rust” by Lily Mara and Joel Holmes, published recently by Manning Publications. I’m pretty sure that the book was supposed to be called “Rewrite it to Rust,” but then someone realized that this is already a meme, so it’d be too much.

Yet, the goal is exactly that – to teach folks how to gradually introduce Rust components to their existing codebases written in C/C++, Java, Python, or JavaScript. Such a goal reflects the intended audience: developers in those languages with little or no knowledge of Rust. One interesting thing, though, is that even Rust professionals might find a lot of interesting details about Rust itself, especially if they are not experienced in such areas as FFI (Foreign Function Interface), Rust-Python interoperability, or WebAssembly – those are the key topics of the book.

In just ten chapters, the authors present the whole topic of using Rust in codebases alongside other programming languages, primarily C, Python, and JavaScript (via WebAssembly). The pace of topic development is quite fast, starting with almost zero, and they reach quite advanced concepts very quickly.

Although the majority of examples are rather simple illustrations of the described approaches, I was impressed with an example of a fully functional extension module for the NGINX web server in Rust. Also, parsing an expression in RPN (reverse polish notation) or visualizing Mandelbrot sets brings a flavor of those old-style classic books that teach programming, not technology.

The authors exercise the pull model of teaching. They bring more information about Rust when it’s actually required, without trying to present everything in advance. They start following this model right after Chapter 2, where they give a high-level overview of unique Rust features such as lifetimes, ownership, or Rust’s approach to error handling. Of course, Rust folks already know this stuff, but I’d still recommend not skipping this chapter, because the explanations in the book are quite good, and we often have to explain those things to others, so why not learn how to do that in a good way.

One other marker of a good teaching style used in the book is how the authors introduce the context of a topic they are about to present. For example, in Chapter 6, they have a section on benchmarking. This is how they start:

“Benchmarking is a topic fraught with opportunities for misunderstanding and confusion. If not constructed properly, benchmarks can provide misleading results that give one experimental path an unfair advantage over another. ”

Lily Mara and Joel Holmes, from Refactoring to Rust 

The authors continue with important ideas about benchmarking in general and do not just dive [yes, it’s not AI, it’s me who wants to use this word] into technical details. In other chapters, they talk about Java or Python history and their significance for the industry, thus creating a feeling that introducing Rust is not going to undermine their strengths but bring new value instead. In Chapter 9, before talking about React components, I found a great intro to component-oriented programming. All these discussions make the book very engaging.

As the readers might come from different backgrounds, the authors provide lightweight yet precise helpers:

  • Don’t know what’s Vec in Rust? Here’s how to say that in Java or Python.

  • Have you never heard about virtual environments or the Global Interpreter Lock in Python? Here’s a short explanation that is just enough.

  • Does the concept of program stacks and memory heaps sound alien to you? No problem at all. With a bit of visualization, you’ll get a sufficient understanding.

  • What the heck are language bindings? The book has got you covered.

  • Name mangling? Monkey patching? Property testing? No worries. Keep calm. Just read.

Having said all these nice things about the book, I also have a complaint. In one of the examples, in a Rust build script, they choose how to greet the user depending on the chosen language specified by some environment variable. Should it be “Hello!”, or “Hallo!”, or maybe “¡Hola!”? Do you know what they use for my beloved Greek? Unexplainable formal all lowercase “γεια σας” even without an exclamation mark! Folks, it should be “Γεια!”, believe me, I’ve just got my Α2 άριστα test results στα Ελληνικα. That’s something I spent so much time on instead of reading books and writing about them.

Well, anyway, I totally recommend reading “Refactoring to Rust”, even if you’re not planning to rewrite anything in Rust. You’ll definitely enjoy it. And then, who knows…