Intro to Rust
Let's Get Rusty
Race to Replace C has already ended… and Rust is the clear winner.
What is Rust?
Rust was designed by Software developer Graydon Hoare while working at Mozilla Research in 2006. Know more about the history and evolution of Rust.
Rust is a multi-paradigm, strongly typed, blazingly fast, a memory-efficient language designed for safety and performance. Rust guarantees memory safety and thread safety, empowering developers to debug at compile time.
Install on Linux & macOS:
Fire up a terminal and paste the below command snippet.
curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh
The above command snippet downloads and installs rust in your system.
If you get linker errors, you should install a C compiler, which will typically include a linker. A C compiler is also useful because some common Rust packages depend on C code and will need a C compiler.
sudo apt install build-essential
Install on Windows:
Refer to the link to install rust on your windows machine.
Write your first program in Rust.
Open a new terminal and create a directory.
Change your present working directory to the directory you created.
Create a new file called
first_program.rs and add the following lines to that file.
Compile your first program by running the command.
Which creates an executable binary that can be executed by running:
If you see
Hello World in your terminal, Hurray!! You have successfully written and executed your first program in rust.
Did you find this article valuable?
Support Shreyas K S by becoming a sponsor. Any amount is appreciated!