Begin Rust is a complete guide to the Rust programming language. If you're a new programmer looking to get into a first language, or an experienced programmer looking to learn the Rust language, we hope this book will serve you well.
Rust is a relatively new programming language that has gained significant popularity in the past few years. It is pioneered by Mozilla, and is designed to solve some major problems in the programming community. We won't try to sell you on Rust here. If you want more information, please check out https://www.rust-lang.org/.
Rust has a reputation of being difficult to learn. While Rust is a powerful and flexible language, we also believe that it can be approachable, given the right learning path. This book is aimed at making Rust as easy as possible to learn for people of all skill levels.
Michael and Miriam have been working on documentation, blog posts, tutorials, and books aimed at programmers for years. They've written countless blog posts on their personal blog, the Yesod Web Framework blog, and elsewhere. They have written previously on web development in the Haskell programming language in the O'Reilly book Developing Web Apps with Haskell and Yesod.
Michael is a prolific open source developer, authoring and maintaining dozens of popular libraries in the Haskell ecosystem. Michael has been in software development for twenty years, and regularly speaks on the topic and provides training. Michael is passionate about teaching programming and making it accessible. This book is the latest culmination of that passion.
Miriam has a background in linguistics, and has been programming off and on for the past 14 years. Miriam has regularly read, reviewed, edited, and generally improved a large body of technical writing on Haskell and Rust. More recently, Miriam has stepped into the role of educator, using this book as a basis for teaching Rust to school-aged new programmers.
Why this book?
We've taken great care to make this book approachable for a wide variety of audiences. We've focused intensely on making sure the content builds upon itself linearly, avoiding confusion among new learners. We've provided appropriate exercises throughout to reinforce the material.
Given our original audience of younger programmers, we knew that we needed to provide a rewarding experience, minimizing failure points as much as possible. This has allowed us to use this as a teaching text, and we believe it will encourage success for others as well. If you're a programmer looking to help your friends or family learn programming, or you yourself have had trouble picking up Rust in the past, we think this is a great resource.
And while this attention to detail may not be vital for experienced programmers looking to pick up a new language, we think you'll enjoy the gentle onramping it provides.
- Declaring and using variables
- Blocks, expressions, and statements
- Declaring and calling functions
- Booleans and boolean logic
- Mutable variables
- while loops
- Custom structs
- References and mutable references
- Declaring and making method calls
- Strings: slices, references, and ownership
- Arrays, Vecs, and slices
- Type parameters/generics
- Custom enums
- The Option type
- Iterators and for loops
- Early exit and error handling