Skip to the workspace
Pebellslearn by building
Introduction to Rust  ›  Lesson

What Rust Is and Why People Choose It

What is Rust? 12 minRust is a compiled systems language that gives C-like speed and control while its compiler rules out whole classes of memory bugs before the program runs.

Set up Rust and run your first file

Use rustup to install a stable Rust toolchain, then let Cargo create and run a small project. Rust also needs your platform’s native linker tools.

Already set up? Continue to the lesson

New to coding? Meet the tools and find the terminal
rustup
Installs and manages Rust toolchains.
rustc
Compiles Rust source.
Cargo
Creates projects and runs their builds, tests and dependencies.

A terminal is a window for commands. Its shell interprets those commands. PATH is the list of folders the shell searches for programs. An editor extension adds editing help; it usually does not install the language itself.

In VS Code, open your project folder, then choose View → Terminal. Type at the cursor in the Terminal panel, not in Output, the source file, or the browser address bar. Our command blocks omit prompt symbols such as $ and >; do not add them.

Official VS Code screenshot: the Terminal tab is selected below the editor, with the PowerShell shell name at the right and a command prompt at the left.
Find the Terminal tab and shell name. Open full-size screenshot (new tab).

The dropdown next to the plus button selects a shell. Choose the shell named in your operating-system instructions below. Available choices depend on what you installed.

Official VS Code screenshot: the arrow beside the terminal plus button opens a list containing PowerShell, Command Prompt, Git Bash and Ubuntu WSL.
Official documentation screenshots by Microsoft, VS Code terminal guide, CC BY 3.0 US. Unmodified; your version may look different.

Choose a system to see its installation steps. A computer is needed for these local setup instructions.

Official documentation and illustrated guides

Instructions reviewed 2026-10-27. Use the linked installer page for current versions and supported operating systems.

Continue to the lesson

rust / What Rust Is and Why People Choose It

Explore each scene at your own pace.

01 · The rule

The rule

What Rust Is and Why People Choose It

Rust is a compiled systems language that gives C-like speed and control while its compiler rules out whole classes of memory bugs before the program runs.

Relate Rust's ownership checks to memory safety and resource cleanup.

Imagine a program that tracks every book in a busy lending library. It must answer thousands of requests a second, and it must never mix up who has which book. Most languages make you choose: fast but risky (C, C++) or safe but slower (Python, Java). Rust was built to refuse that trade.

The rule

Rust: machine-code speed, with memory mistakes caught at compile time.

Rust is a compiled language. The compiler, rustc, turns your source into a native executable, the same kind of file a C compiler produces. There is no interpreter and no virtual machine at run time.

Rust has no garbage collector. Instead, every value has one owner, and the value is freed the moment its owner goes out of scope. The compiler works out exactly where that happens, so memory is released without a pause to scan for garbage.

The compiler is strict on purpose. Its borrow checker rejects programs that could read freed memory, keep a pointer to something that has moved, or let two threads change the same data at once. In C those are run-time crashes; in Rust they are compile errors.

fn main() {
    let title = String::from("The Salt Road");
    println!("Now lending: {title}");
}

That is a complete program. fn main is where it starts, let creates a variable, and println! (the ! marks a macro) prints a line.

Where Rust shows up: command-line tools, web servers, browsers, game engines, embedded devices, and code compiled to WebAssembly. Anywhere speed and reliability both matter.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.