---
title: "Chapter 1: Rust Basics"
description: "The 13 lessons of chapter 1: Rust Basics, in teaching order."
url: "https://learnrust.net/chapter-1/"
last_updated: "2026-06-11"
---

# Chapter 1: Rust Basics

- [1.1 Statements and the structure of a program](https://learnrust.net/chapter-1/statements-and-program-structure.md): What statements are, why every Rust program starts at fn main, and a line-by-line dissection of Hello, world.
- [1.2 Comments](https://learnrust.net/chapter-1/comments.md): Rust comments: // and /* */ syntax, what to comment and why, and commenting out code.
- [1.3 Introduction to values and variables](https://learnrust.net/chapter-1/values-and-variables.md): Data, values, RAM, and Rust variables: what let does, and how the compiler tracks every variable's type.
- [1.4 Variables, mutability, and initialization](https://learnrust.net/chapter-1/variables-mutability-initialization.md): Why Rust variables are immutable by default, what let mut does, and how the compiler makes uninitialized reads impossible.
- [1.5 Introduction to println! and formatting](https://learnrust.net/chapter-1/println-and-formatting.md): Printing in Rust: println! versus print!, placeholder syntax, named and positional arguments, and escape sequences.
- [1.6 Reading input: a first look](https://learnrust.net/chapter-1/reading-input.md): Reading user input in Rust with stdin and read_line, why the input keeps its newline, and what trim does.
- [1.7 Compiler errors and how to read them](https://learnrust.net/chapter-1/reading-compiler-errors.md): The anatomy of a Rust compiler error: error codes, spans, labels, help lines, and the habit of reading the first error first.
- [1.8 Keywords and naming identifiers](https://learnrust.net/chapter-1/keywords-and-identifiers.md): Rust's reserved keywords, the rules for identifiers, and the snake_case naming conventions the compiler itself nudges you toward.
- [1.9 Whitespace and basic formatting](https://learnrust.net/chapter-1/whitespace-and-formatting.md): How Rust treats whitespace, the standard 4-space style, and how cargo fmt ended the formatting wars.
- [1.10 Introduction to literals and operators](https://learnrust.net/chapter-1/literals-and-operators.md): Literals, operands, and operators in Rust, including why the ++ and -- operators don't exist.
- [1.11 Expressions and statements](https://learnrust.net/chapter-1/expressions-and-statements.md): Rust is an expression-oriented language: blocks produce values, semicolons discard them, and the unit type fills the gaps.
- [1.12 Developing your first program](https://learnrust.net/chapter-1/developing-your-first-program.md): Build a complete small Rust program step by step, hit a real compiler error, fix it, and compare three working solutions.
- [1.x Chapter 1 summary and quiz](https://learnrust.net/chapter-1/chapter-1-summary-and-quiz.md): Every term from Chapter 1 in one place, plus a quiz that ends with writing a complete program.

## Sitemap

See the full [sitemap](https://learnrust.net/sitemap.md) for all pages.
