Installation
Rust Compiler
The recommended way to install Rust is using Rustup. Rustup is an official first-party tool released by the Rust project which allows you to install and manage versions of rustc (the rust compiler), cargo (the rust build tool), clippy (the rust linter), rustfmt (the rust code formatter) and more. Rustup also allows you to easily upgrade to the latest version of rust when a new version, and even install multiple versions of Rust and switch between them.
It is not recommended to install Rust through your distribution package manager. These packages are intended to compile programs packaged by the distribution, not for Rust development, and they are often so outdated that the latest versions of libraries won't compile.
To install Rustup:
-
On macOS or Linux
Run the following command:curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
On Windows
Download and run this installer: rustup-init.exe
For more details and documentation on rustup are available in the rustup book.
Editor Setup
Learning Resources
Books
- The Rust Programming Language The official rust-lang book. Aimed at those with experience in another programming language but not necessarily a low-level one. This is also the best option if you are trying to learn Rust as your first programming language. Freely available online (a print version is also available)
- Programming Rust Another book aimed at those with experience in another programming language, but not necessarily a low-level one. While the official book above has a stellar reputation, this one has a reputation for being even better, diving deeper and giving a more thorough introduction to the language. The downside being it's not free.
- Zero To Production In Rust Aimed at developers with a background in backend web development. Starts with the basics of setting up a development environment, and takes the reader all the way through to creating a robust production-ready web service.
- Rust In Action This one has a slightly different focus, and is more suited to the more experienced developer with some grasp of CS theory, or those coming from a background in C or C++. It takes the reader through some relatively advanced projects including a CPU emulator, database, and an OS kernel.
- Rust For Rustaceans A more advanced book that dives into some of the more involved parts of Rust. Not suitable for a complete beginner (even if they have experience in other languages). Best read after you have already learnt some basic Rust through one or more of the other resources.