What is Rust?
Part 1 · Rust. Meet Rust: what a programming language is, why Rust is fast and safe, who uses it, and how this course takes you from zero to Laravel Rust.
Welcome to FirstCrate! If you have never written a line of code, you’re in the right place. If you’ve tinkered with a bit of PHP or JavaScript, that’s a bonus, but you won’t need it. We start from zero, go one small step at a time, and build real things along the way.
What is a programming language?
A computer is extremely fast, but it only understands very simple instructions stored as numbers. Writing those numbers by hand would be miserable. So instead we write programs: lists of instructions in a language that humans can read. A tool then translates them into something the machine can run.
Think of a recipe card in a café kitchen. The barista doesn’t need to know why the steps are in that order. They follow them exactly, top to bottom. A program is a recipe card for a computer, and the computer is a very fast, very literal barista.
Here is a tiny Rust program:
fn main() { println!("Welcome to Rusty Bean Café!");}Even without knowing Rust, you can probably guess what it does. Here’s what each part means:
fn main()starts a function calledmain. A function is a named group of instructions. Every Rust program starts running atmain.- The curly braces
{ }wrap the instructions that belong tomain. println!("...")prints a line of text to the screen.- The semicolon
;marks the end of an instruction, like a full stop at the end of a sentence.
When you run it, you see:
Welcome to Rusty Bean Café!You’ll write and run this program yourself in two lessons’ time.
Compiled vs. interpreted
Rust is a compiled language. A program called the compiler (for Rust it’s named rustc) reads all your code, checks it carefully, and turns it into a standalone program called an executable. Your computer then runs that executable directly.
PHP and JavaScript usually work differently. They are interpreted: another program reads your code and runs it on the fly, line by line.
An analogy: an interpreter is like a live translator at a meeting, translating each sentence as it’s spoken. A compiler is like translating a whole book before printing it. The translation takes a moment up front, but then anyone can read the book quickly, and mistakes get caught before it goes to print.
Why Rust?
Rust is popular for two big reasons that usually fight each other: speed and safety.
Speed
Rust programs run about as fast as programs written in C and C++, the languages behind operating systems, web browsers and video games. Rust doesn’t need a garbage collector (a helper that pauses your program now and then to clean up unused memory), so its performance is fast and predictable.
Safety
Many serious bugs in fast languages come from misusing memory. A program might read data that has already been thrown away, or two parts of a program might change the same data at the same time. These bugs cause crashes and security holes.
Rust’s compiler checks for these mistakes before your program ever runs. If your code could go wrong in those ways, it won’t compile, and the compiler tells you why.
Note
At first this strictness can feel like the compiler is nagging you. That’s normal! Rust’s error messages are famously friendly. They point to the exact line and often suggest the fix. Think of the compiler as a patient head barista who checks every drink before it leaves the counter.
Other nice things
- Cargo, Rust’s built-in helper tool, creates projects, downloads libraries and runs your code with one command.
- Great tooling: automatic formatting (
cargo fmt), a “linter” that suggests improvements (cargo clippy), and excellent editor support. - A welcoming community with lots of free learning material.
Who uses Rust?
Rust started as a project at Mozilla (the makers of Firefox) and reached version 1.0 in 2015. Today it’s used by companies such as Amazon Web Services, Microsoft, Google, Cloudflare, Discord and Dropbox. Parts of Android, Windows and the Linux kernel are written in Rust. Developers have voted it one of the most admired languages in the Stack Overflow Developer Survey year after year.
You don’t need to work at a giant company to use it, though. People use Rust for command-line tools, web servers, games, tiny embedded devices and, now, full-stack web apps.
What is Laravel Rust?
Laravel is one of the most loved web frameworks in the PHP world. A framework is a ready-made toolkit for building a certain kind of program, so you don’t have to start from an empty page. On December 1, 2026, the Laravel team released the first beta of Laravel Rust (read the announcement (opens in new tab)). It brings Laravel’s batteries-included approach (routing, typed validation, database models, queues, workflows, mail, broadcasting, Inertia and more) to Rust, combining Laravel’s productivity with Rust’s speed and safety.
Why learn Rust first? A framework is built on top of a language. When you use Laravel Rust, you’ll be writing Rust: variables, functions, structs, error handling and more. If you know the basics, the framework feels natural. If you don’t, every error message will be confusing. So we build a solid foundation first, then put it to work.
Important
Laravel Rust is in beta, which means some details may change before the final release. The Rust you learn in the first half of this course is stable and won’t go out of date.
Meet Rusty Bean Café
To keep things concrete, this whole course follows one example: Rusty Bean Café, a small coffee shop. In the Rust lessons we’ll model its menu, prices, orders, stock and customers. In the Laravel Rust lessons we’ll build the café’s real ordering website, from the menu page to receipt emails.
One habit we’ll use from the very start: prices are stored in cents as whole numbers. A latte costs 450 cents, not 4.50 dollars. Computers can’t store some decimal numbers exactly, and nobody wants a till that’s off by a fraction of a cent. You’ll see why in the data types lesson.
How this course works
- Short lessons. Each covers one idea and takes about 5 to 15 minutes.
- Code you can run. Every complete example runs, except the ones deliberately marked as error demos (where we break things on purpose to read the compiler message). A few later examples use outside libraries (called crates) such as
tokioandserde; those need the dependency lines the lesson shows inCargo.toml. Type the examples yourself instead of copying and pasting; your fingers learn as well as your eyes. - Try it yourself. Each lesson ends with a small exercise and a hidden solution. Try before you peek!
- Two halves. First we learn Rust from zero. Then we use it to build web apps with Laravel Rust.
Tip
Don’t try to memorize everything. Professional developers look things up all day long. Aim to understand the ideas, and the details will stick with practice.
Try it yourself
No coding yet. Instead, warm up your “programmer brain”. Write down, in plain English, the step-by-step recipe a barista at Rusty Bean Café follows to take one order: from greeting the customer to handing over the cup. Try to make each step small and exact, as if the barista follows instructions literally.
Show solution
There’s no single right answer. Here’s one version:
- Greet the customer.
- Ask what drink they want.
- Look up the drink’s price on the menu.
- Ask if they want anything else. If yes, go back to step 2.
- Add up all the prices.
- Take payment.
- Make each drink.
- Hand over the drinks and say thank you.
Notice step 4 repeats steps until a condition is met, and step 5 does arithmetic. Those are a loop and a calculation, two things you’ll write in Rust very soon.
Recap
- A programming language lets you write readable instructions (a program) for a computer.
- Rust is compiled: the compiler checks your code and builds an executable before it runs.
- Rust’s big strengths are speed and safety, backed by friendly tools like Cargo.
- Laravel Rust is a new full-stack web framework for Rust (beta released December 1, 2026). We learn Rust first so the framework makes sense.
- Our running example is Rusty Bean Café, and we store prices as whole cents.
What’s next
Time to get Rust onto your computer. Head to Installing Rust to set up Rust, Cargo and a comfy editor.
0 of 35 lessons complete