# Getting Started with Rust: Installation and Hello World Program

Rust is a powerful systems programming language that focuses on safety, performance, and concurrency. Whether you are a seasoned developer or just starting your programming journey, learning Rust can be a rewarding experience. In this blog post, we will guide you through the installation process and help you write your first Rust program - the classic "Hello, World!" program.

### **Installing Rust**

Before we dive into writing Rust code, let's get Rust installed on your system. Follow these simple steps:

**Visit the Official Rust Website**: Open your web browser and go to the official Rust website: [https://www.rust-lang.org/tools/install](https://www.rust-lang.org/tools/install)

**Select the Correct Download**: Rust supports various platforms, including Windows, macOS, and Linux. the website should automatically detect your operating system. If it doesn't, select your platform from the list provided.

**Run the Installer**: Once the download is complete, run the installer. The installation process will vary depending on your operating system. Follow the on-screen instructions to complete the installation.

**Verify the Installation:** To ensure Rust is properly installed, open a terminal or command prompt and type the following command.

`rustc --version`

If the installation was successful, you should see the installed Rust version displayed on the screen.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1690214912927/6d83027f-1b86-41c4-913e-cd0d490c01f5.png align="center")

Congratulations! You've successfully installed Rust on your system. Now, let's move on to writing our first Rust program.

### **Hello, World! In Rust**

The "Hello, World!" program is a simple tradition in the programming world. It's a basic program that prints the words "Hello, World!" to the console. In Rust, it's just as straightforward. Follow these steps to write and run your first Rust program:

**Create a New Project:** Open your favorite text editor or IDE (mine is [VSCODE](https://code.visualstudio.com)) and create a new file. Save it with a **.rs** extension, which indicates it's a Rust source code file. For example, name it **hello\_world.rs**.

**Write the Code:** Open **hello\_world.rs** and type the following code:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1690215751530/103a9ed4-656e-4ae5-afb6-33fb6d39a82c.png align="center")

In Rust, the `main` function is the entry point of the program. The `println!` macro is used to print text to the console.

we will discuss more `macros` in an upcoming lesson.

**Compile the Program**: Open your terminal or command prompt and navigate to the directory where you saved **hello\_world.rs**. Use the following command to compile the Rust code:

`rustc hello_world.rs`

This will generate an executable file named **hello\_world** in the same directory.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1690216220805/42120d18-3090-4494-bdb6-582f1d067dd9.png align="center")

**Run the Program**: To run the compiled program, simply type its name in the terminal and press Enter:

`./hello_world`

If everything went well, you should see the output: "Hello, World!" displayed on the screen like the below screenshot.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1690216310209/ce91fb37-d48c-4ac1-a2ce-086be787e45c.png align="center")

Congratulations! You've completed your first steps with Rust. You installed Rust on your system and wrote a simple "Hello, World!" program.
