Vibe Engines
YouTube

Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path

Learn RustChapter 1: Hello

Lesson 1.2 · 6 min

Make and run a project

Chatterbox needs a home: a folder with your code in it and a tool that builds and runs it. In Rust that tool is called cargo, and you will use it hundreds of times. Today you use it three times.

Adds to ChatterboxThe Chatterbox project exists and runs.

Install once

To follow along on your own machine, install Rust from rustup.rs. It installs the compiler and cargo. You can also stay in the page: every code box in this course runs in your browser. But Chatterbox is a real project, so you will want it on your computer by the end of chapter 3, when it starts reading what you type: that is the first lesson that needs a real terminal.

Make the project

Open a terminal: a window where you type a command, press Enter, and read the answer. On a Mac it is the app called Terminal; on Windows, PowerShell. The terminal examples in this course were run on macOS; Linux looks the same, and on Windows the commands are the same but some output looks slightly different (paths use \, and the program file ends in .exe). Then ask cargo for a new project called chatterbox. (In the box below, each line after the prompt is a command you type. cd chatterbox steps into the new folder, and ls lists what is inside it.)

Make a project
$ cargo new chatterbox
    Creating binary (application) `chatterbox` package
note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
$ cd chatterbox

$ ls
Cargo.toml
src

Cargo's first line says it made a binary (application) package: a project that turns into a program you can run (the other kind, a library, is code for other programs to use). The note: line is just a pointer to the documentation for the settings file; you can ignore it.

Cargo made a folder with two things that matter. Cargo.toml is the project's name tag and settings. src/main.rs is where your code lives. Let us look at both. (cat just prints a file's contents to the terminal.)

The settings file
$ cat Cargo.toml
[package]
name = "chatterbox"
version = "0.1.0"
edition = "2024"

[dependencies]

You can ignore most of this for now. name and version do what they say. [dependencies] is an empty shelf where, in chapter 9, you will list the other people's code Chatterbox uses.

And here is the program cargo wrote for you in src/main.rs. It is the same shape as lesson 1.1. This is the first version of Chatterbox: every later lesson changes this file, and each one shows you the whole program as it stands, with the new lines in green. You can download any version as a zip.

src/main.rs, as cargo wrote it: Chatterbox v0.1 after lesson 1.2
src/main.rs
fn main() {
println!("Hello, world!");
}
Chatterbox prints (a real run)
Hello, world!

Download this version (zip)Unzip, then cargo run inside the folder.

Run it

cargo run does both jobs from the last lesson: it compiles your code, then runs the result.

Build and run
$ cargo run
   Compiling chatterbox v0.1.0 (~/chatterbox)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.21s
     Running `target/debug/chatterbox`
Hello, world!

Cargo prints three lines about its own work before your program speaks. Compiling names the project and where it is. Finished dev profile [unoptimized + debuginfo] means it built a quick, everyday version for while you are working: it skipped the slow speed-ups, and kept extra information that helps when something goes wrong. Running target/debug/chatterbox is the finished program: cargo keeps what it builds in a folder called target, and debug is the folder for that everyday version. The last line, Hello, world!, is the only one your program printed.

Chatterbox exists

That is it. You now have a project called Chatterbox that compiles and runs. It only says "Hello, world!" so far. In the next lesson you change what it says, and learn what makes println! so flexible.

Self-check

Say it out loud, then reveal

Self-checkRetrieval beats re-reading
Which command creates a new project?Reveal
cargo new chatterbox.
What is the difference between cargo run and cargo check?Reveal
cargo run compiles and then runs the program. cargo check only checks that the code makes sense, so it is faster.
Where does your code live?Reveal
In src/main.rs. Cargo.toml holds the project settings.

That is lesson 1.2. Tick it off so the course remembers where you are.

Questions people ask

What is cargo in Rust?

Cargo is the tool that comes with Rust for making projects, building them and running them. It also downloads other people's code that your project uses.

How do I install Rust?

Go to rustup.rs and follow the one-line instructions for your computer. It installs the Rust compiler and cargo together.

What is Cargo.toml?

Cargo.toml is the settings file for a Rust project. It holds the project name, its version, and the list of other code packages it depends on.

Why is cargo check faster than cargo run?

cargo check only asks the compiler whether your code makes sense. It skips producing a finished program and skips running it, so it answers sooner.

Learn Rust by building a chat app · Lesson 1.2 · every compiler message above is real output from rustc 1.99.0 (b940084d7 2026-09-28) (edition 2024) · Vibe Engines · 2026