Member-only story
Getting Started with Rust (Part 2): Rust Syntax, Data Types and Control Flow Basics

Rust is a systems programming language that focuses on safety, speed, and concurrency.
In this part, we will cover the very basics of syntax, variables, data types, ownership, and control flow.
Remember you can test RUST online here. This article is a continuation of the series of articles here.
Syntax and Variables
Rust’s syntax is clean and modern, making it relatively easy to pick up if you are familiar with other programming languages.
Let’s start with the simple print statement!
Example Code: Medium, rulez!
fn main() {
println!("Medium, rulez!");
}
fn
is a keyword used to declare a function.
fn main() { ... }
: This line defines a function namedmain
. In Rust, themain
function is special—it is the entry point of most Rust programs. When you run a Rust program, execution starts from themain
function.println!("Medium, rulez!");
: Inside themain
function, this line is a macro invocation (println!
), not a function call. Rust distinguishes macros from functions using the!
syntax. Theprintln!
macro prints the text"Medium, rulez!"
to the standard output…