Developer tips & trick, one bite at a time

Hello World in Rust

Create a new file in your project called and write the following

fn main() {
    println!("Hello, world!");

In terminal window (mac/linux) run


For windows

> rustc
> .\main.exe

There we go! hello World!

As you notice. Rust requires compiling, before we can run the program. rustrc is the keyword for compiling.

After running rustrc, if you see your project dir, you can see there is main file besides our source code from before It’s the executable file.

This is a post in the start learning Rust series.

🏊🏾‍♀️ Back Home