Camp 1 · Schritt 2 von 12
Hello, Cargo!
Meet Cargo, the build tool other languages envy, and dissect Rust's Hello World.
Most languages bolt on a package manager years later. Rust shipped with Cargo from day one — builder, test runner, dependency manager, and project scaffolder in one command.
The Cargo workflow
On a real machine, a Rust project starts and runs like this:
cargo new hello_trail # scaffold a project
cd hello_trail
cargo run # compile + run in one stepcargo new creates a Cargo.toml (the project manifest) and
src/main.rs:
hello_trail/
├── Cargo.toml ← name, version, dependencies
└── src/
└── main.rs ← your codeDependencies ("crates", from the community registry crates.io) are one
line in Cargo.toml — Cargo fetches, builds, and version-locks them.
(Our playgrounds compile in the cloud, so you can focus on the language.)
Dissecting main.rs
fn main()— functions start withfn;mainis the entry pointprintln!— the!marks a macro (code that writes code — a later adventure; for printing, just include it){}placeholders fill left-to-right with the arguments
Statements end in ;, blocks live in { } — familiar territory if
you've seen any C-family language.
What is Cargo?
Why does println! end with an exclamation mark?
What's next
Variables — and Rust's surprising default that they can't change unless you say so.