Rust is systems programming language gaining popularity due to its “safe, concurrent, practical language”, being memory safe while maintaining performance is the reason why so many people are adopting it as their systems language of choice, winning the first place for “most loved programming language” in the Stack Overflow Developer Survey in 2016 and 2017.
It is open source and sponsored by Mozilla Research. There are many interesting projects like Piston a modular game engine, you can find more project and packages on crates.io,
Install instructions.
Open Terminal and run these commands.
curl https://sh.rustup.rs -sSf | sh
Code language: JavaScript (javascript)
source $HOME/.cargo/env
Code language: PHP (php)
Time to write some rust code.
fn main()
{
print!("Hello World!");
print!("Rust coding day {}", 1);
}
Code language: PHP (php)
Rust file is saved by the extension .rs
.
To compile this file, we need to execute it with Rust compiler.
The compiler is known as rustc
in the command line.
rustc hello.rs
Code language: CSS (css)
Executing the file.
./hello
It will build instantly and create a binary executable as hello.
Running hello
If you have any question leave a comment below.