Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Learn Rust from Scratch

A complete 25-lesson Rust curriculum for experienced programmers. If you know Python, JavaScript, or any other language and want to learn Rust properly, start here.

Every lesson includes real-world analogies, Python comparisons, runnable code examples, common mistakes, and hands-on exercises. All code examples have been compiled and tested against Rust 1.92+.

What Makes This Different

  • Written for programmers, not beginners. No "what is a variable" padding. You already know how to code. This teaches you what Rust does differently and why.
  • Python comparisons throughout. Every new concept is anchored to something you already know. Ownership is explained through physical analogies, not academic jargon.
  • Every code example compiles and runs. Output comments in the code match actual program output. Intentionally broken examples are clearly marked.
  • Common mistakes in every lesson. The traps Rust beginners fall into, with explanations of why they happen and how to fix them.
  • Exercises that build skill. 3-5 exercises per lesson, progressing from basic to challenging.

Curriculum

Part 1: Foundations

Lesson Topic What You Learn
00 Setup and Cargo Install Rust, create projects, Cargo commands
01 Variables and Types let, mut, integers, floats, tuples, arrays, shadowing
02 Functions and Control Flow Expressions vs statements, if/else, loops, match
03 How Memory Works RAM, stack, heap, pointers, where Rust types live
04 Memory Safety The 4 critical bugs, how exploits work, GC vs manual vs ownership
05 Ownership The three rules, move semantics, Clone, Copy
06 Borrowing and References References, the borrow checker, slices

Part 2: Structuring Code

Lesson Topic What You Learn
07 Structs and Methods Defining structs, impl blocks, methods, ::new
08 Enums and Pattern Matching Algebraic types, Option, match, if let, let else
09 Error Handling panic!, Result, the ? operator, anyhow, thiserror
10 Collections Vec, String, HashMap, ownership in collections
11 Modules and Crates Code organization, visibility, use, external crates

Part 3: Abstractions

Lesson Topic What You Learn
12 Generics Generic functions/structs, monomorphization, turbofish
13 Traits Trait bounds, static vs dynamic dispatch, std traits
14 Lifetimes Annotations, elision rules, lifetimes in structs
15 Closures and Iterators Fn traits, iterator chains, zero-cost abstractions

Part 4: Advanced

Lesson Topic What You Learn
16 Smart Pointers Box, Rc, RefCell, Arc, Deref, Drop
17 Concurrency Threads, channels, Mutex, Arc, Send/Sync
18 Async/Await Futures, tokio, spawn, join!, select!
19 Strings Deep Dive String vs &str, UTF-8, Cow, OsString
20 Unsafe Rust The 5 superpowers, raw pointers, FFI
21 Macros macro_rules!, procedural macros, derive

Part 5: Practical

Lesson Topic What You Learn
22 Testing Unit tests, integration tests, doc tests
23 Common Patterns Builder, Newtype, Type State, RAII, From/Into
24 Project: CLI Tool Build a mini grep from scratch

How to Use

Start from lesson 00 and go in order. Each lesson builds on the previous ones.

Lessons 03-06 (Memory, Safety, Ownership, Borrowing) are the hardest stretch. Take extra time on those -- they are what make Rust unique.

Reading in the Browser

The repo includes a web UI for reading lessons with syntax highlighting. No build tools needed.

git clone https://github.com/wasxxm/learn-rust.git
cd learn-rust
python3 -m http.server 8765

Then open http://localhost:8765/web-ui/ in your browser.

Reading on GitHub

All lessons are markdown files in the root directory. GitHub renders them with syntax highlighting. Just click any lesson link above.

Prerequisites

  • Experience with at least one programming language (Python, JavaScript, Go, Java, etc.)
  • Rust installed via rustup
  • A terminal and a text editor

Contributing

Found a bug in a code example? An explanation that could be clearer? Open an issue or submit a PR. Every code example in this repo has been compiled and tested, so please verify your changes compile before submitting.

License

This project is licensed under the MIT License. See LICENSE for details.

About

Complete 23-lesson Rust curriculum for experienced programmers. Real-world analogies, Python comparisons, tested code examples, and exercises.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages