codingstuff.io
ExploreTutorialsProblemsCS Subjects
Get Started
ExploreTutorialsProblemsCS Subjects
Get Started
codingstuff.io

Master the art of building software through interactive tutorials, real-world problems, and guided projects.

Pune, Maharashtra, India

codingstuffmail@gmail.com

Product

  • Explore
  • Tutorials
  • Problems
  • CS Subjects

Company

  • About
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Sitemap

© 2026 codingstuff.io. All rights reserved.

Built with ❤️ for developers everywhere

/
/
All Tutorials
🦀

Rust

3 / 58 topics
1Getting Started with Rust2Installing Rust3Hello World Program4Rust Syntax5Variables and Mutability6Data Types7Operators
Tutorials/Rust/Hello World Program
🦀Rust

Hello World Program

Updated 2026-05-15
10 min read

Hello World Program

Introduction

Welcome to the world of Rust! In this tutorial, we'll walk you through writing and running a simple "Hello, World!" program in Rust. This is a great starting point for beginners and will help you understand the basic structure and syntax of a Rust program.

Rust is a statically typed systems programming language known for its performance, safety, and concurrency features. It compiles to machine code that runs blazingly fast, making it an excellent choice for both small scripts and large-scale applications.

Concept

A "Hello, World!" program is the traditional first program written by people learning to code in a new language. Its purpose is simple: to display the message "Hello, World!" on the screen. This program will help you understand the basic components of a Rust program, including the entry point and how to print output.

In Rust, every application starts with a main function. The main function is where the execution of your program begins. To print text to the console, you'll use the println! macro, which stands for "print line."

Examples

Let's dive into writing and running our first Rust program.

Step 1: Create a new Rust project

First, you need to set up a new Rust project. If you haven't installed Rust yet, you can do so by following the instructions on the official Rust website.

Once Rust is installed, create a new directory for your project and navigate into it:

Terminal
mkdir hello_world
cd hello_world

Next, initialize a new Rust project using Cargo, which is Rust's package manager and build system:

Terminal

Cargo will compile your code and execute the resulting binary. You should see the following output in your terminal:

Output
Compiling hello_world v0.1.0 (/path/to/hello_world)
  Finished dev [unoptimized + debuginfo] target(s) in 0.53s
   Running `target/debug/hello_world`
Hello, World!

Congratulations! You've successfully written and run your first Rust program.

What's Next?

Now that you've created a simple "Hello, World!" program, it's time to dive deeper into Rust syntax. In the next section, we'll explore more about variables, data types, and basic control structures in Rust. Stay tuned!

If you have any questions or run into issues, feel free to ask for help in the comments below. Happy coding!


PreviousInstalling RustNext Rust Syntax

Recommended Gear

Installing RustRust Syntax