preface

 

Throughout our software careers, we’ve had the opportunity to participate in several refactoring projects. The narrative is often the same: products need to scale, but time is limited. This situation leads to extensive development efforts over months, filled with discussions about patterns and languages.

Refactoring with Java and Go involved significant challenges, including constant file moving, package exports, system wrappers, and outright rewrites of existing systems. The paths to success were rarely clearly defined. This book aims to provide you with many of these patterns, using a language designed for breaking down and rewriting existing systems. Refactoring to Rust demonstrates how Rust can seamlessly integrate into your ecosystem, delivering scaling benefits from day one due to the nature of the language.

Rust brings advantages, such as type safety and memory safety, along with performance gains attributed to these properties. In this book, you will learn how Rust can enhance nearly any project. Positioned to replace existing languages like C and C++, Rust stands out for its robust toolchain and memory safety features. We will also explore how Rust can interact with languages like Python, revealing performance improvements when building libraries and modules that work across both languages. Additionally, we’ll discover unexpected uses for Rust, such as in web browsers and as a universal runtime.