Rust on Mac

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
source $HOME/.cargo/env

Time to write some rust code.

fn main() {
print!("Hello World!")
print!("Rust coding day {}", 1);
}

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

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.

Author: Darryl

I am a self-taught programmer and CG Artist, I write on programming and 3D Animation, tips, and tricks and my experience with things, sometimes I write content on demand if the topic interests me. I love sharing knowledge,

Leave a Reply