Название: The Secrets of Rust: Tools Автор: John Arundel Издательство: Bitfield Consulting Год: 2025 Страниц: 240 Язык: английский Формат: pdf (true), mobi, epub Размер: 10.1 MB
Are you ready to unlock the secrets of Rust? Master the world's most loved programming language with this cheerful and encouraging book for beginners and improvers, and learn how to craft stable, reliable, and durable software for this century and the next.
This friendly, supportive, yet challenging book will show you how master software engineers think, and guide you through the process of designing production-ready command-line tools in Rust, step by step.
This book is aimed at those who have a little experience with Rust (or even a lot), and would now like to learn how to build good software with it. What is “good” software anyway? What would it look like in Rust? And how do we get there from here?
"Rust is now being used increasingly in critical software, and what I mean by that is high stakes: life and livelihood on the line. It could be life-saving medical equipment, it could be lynchpin financial services, urgent countermeasures in war zones, low-margin control systems like nuclear reactors, space shuttles, or even cars. This is where we want Rust to be, because we think Rust has unique properties that make it the right tool for doing this successfully." - Jon Gjengset
If you want to learn why Rust consistently tops polls of the most admired languages, and why its popularity is rising fast among those who want to build safe, reliable, and high-performance software, this is the book for you. You'll master a guided-by-tests workflow for designing user-friendly APIs and building libraries of trusted, stable, high-quality software components suitable for critical applications.
You can play the book on three difficulty levels:
1. Easy: just follow along as we develop the solutions to each challenge; they’re explained line by line and step by step, so even if you have practically no Rust experience, you should still be able to follow everything just fine.
2. Medium: you can attempt each challenge yourself, but get hints and guidance on the right way to solve the problem, before reading on to see the suggested solution.
3. Hard: tackle the challenges without reading the hints, and use your own initiative to figure out what to do. You can still look at the hints if you get stuck, but the more you can do on your own, the more it’ll build your confidence as a Rust programmer.
What you’ll learn: By reading through this book and completing the exercises, you'll learn:
How to build reusable crates instead of one-off programs How to design user-friendly APIs, without annoying paperwork How to write robust, testable tools that take command-line flags and arguments How to detect, manage, and present run-time errors How to design Rust crates that work with files and other kinds of binary data How to encode and decode data in binary format, and translate Rust data to and from JSON How to create robust, reusable client packages for HTTP services and other APIs How to launch external commands and capture their output, how to parse arguments and subcommands, and how to add new features to the Cargo tool How to write useful, informative, and high-quality automated unit tests and integration tests
Who is this book for? This book is aimed at those who have a little experience with Rust (or even a lot), and would now like to learn how to build good software with it. What is “good” software anyway? What would it look like in Rust? And how do we get there from here? There are lots of books that will teach you Rust, but not many that will show you what to do with it. In other words, once you’ve learned how to write Rust code, what code should you write? How do you bridge the yawning gap between toy programs for simplified tutorials, and software that actually solves problems in the real world?
If software engineering is a craft, which it surely is, then how do we go about mastering it? It’s all very well to say “just write programs”, but how? How do we take some problem and start designing a program to solve it? How can we incorporate tests into the design? What are we even aiming to do here? I hope you’ll find at least some useful answers to these questions in this book, which focuses on developing command-line tools, but most of it applies to any kind of Rust program.