Rust is a free and open-source low-level programming language developed Graydon Hoare in 2006. Rust is an incredible powerful language that offers low-level control while removing the restrictions and dangers of manual memory management. No, it does not use a garbage collector.
Rust is a popular choice in environments where performance and reliability is of utmost importance. Example would include system kernels, database engine, game engines, networking protocols, browsers and more.
The Rust syntax is comparable to that of C++, provides performance on par with modern C++, and for many experienced developers, Rust is easily adopted and manageable.
Through this tutorial, you will discover how to setup a Rust development environment on Windows in simple steps.
Rust Toolchain and Ecosystem
When developing in Rust, you will come across the following features:
- A crate is a Rust unit of compilation and linking. A crate can exist in source code form, and from there it can be processed into a crate in the form of either a binary executable (binary for short), or a binary library (library for short).
- A Rust project is known as a package. A package contains one or more crates, together with a
Cargo.toml
file that describes how to build those crates. rustup
is the installer and updater for the Rust toolchain.- Cargo is the name of Rust’s package management tool.
rustc
is the compiler for Rust. Most of the time, you won’t invokerustc
directly; you’ll invoke it indirectly via Cargo.- crates.io (
https://crates.io/
) is the Rust community’s crate registry.
Step 1 - Installing Rust
To install Rust, open your browser and head over to the Rust page.
https://www.rust-lang.org/
Click on the Get Started option to get to the download’s page. The website will automatically detect your operating system and provide installers for your system.
Select the installer package for your system and download.
Once the download is complete, launch the installer package and follow along the provided instructions. Choose option 1 to setup Visual C++ Build Tools.
Click install to begin the download and installation process.
This process may take a few minutes to complete.
Once the process is complete, click Ok to close the Build Tools installer and head back to the rust installation processes.
The rust installer package will download and install all the required components such as cargo, rust compiler, documentation, etc.
Once completed, you should see a message as shown:
Press the Enter key to complete teh process.
Bonus - Install Microsoft C++ Build Tools and Additional Tools
As an added bonus, you can install the Build Tools and other development components as shown in the sections below:
Open your browser and navigate to the resource below:
https://visualstudio.microsoft.com/visual-cpp-build-tools/
Download build tools and start the installer.
Click Continue on the setup Window
On the Components Window, select—.NET desktop development, Desktop development with C++, and Universal Windows Platform development.
Finally, click install to begin the installation process.
Once you are done, you can proceed with your Rust development.
Closing
In this article, we explored the process of downloading and installing the Rust compiler on Windows 11. If this article helped you, feel free to share and leave us a comment down below.
Check out our other tutorials and let us know if you want to see other Rust tutorials.
Thanks for reading!!