Development
Code
Rust
Rust
Course
Rust course: from the first program to capstone projects
Ownership, borrowing, traits, threads, three capstones, lesson by lesson.
Open
→
C++
Rust and C++ side by side
The same task in both languages, and the C++ habits that the Rust compiler rejects.
Open
→
All articles
rust/
basics/
(1)
Rust basics: what the language is and where it is used
course/
(143)
Rust course: from the first program to capstone projects
1 What Rust is and where it runs
2 Install Rust on Linux, macOS and Windows
3 An editor, cargo and gdb
4 Your first Rust program
5 Warnings, errors and rustc's suggestions
6 A crate, a module and separate compilation
7 Variables, mutability and types
8 Operators, comparisons and bool
9 Conditions, loops and labels
10 Functions and expressions
11 Ownership and moves
12 Copy, Clone and explicit duplication
13 Drop, scope and RAII
14 Shared references
15 Mutable references and aliasing
16 Slices of arrays and strings
17 Lifetimes and elision
18 Structs and field initialisation
19 impl, self and associated functions
20 const, static and interior mutability
21 Recursion and the stack
22 Patterns and destructuring
23 Integers, floats, overflow and casts
24 char, bytes and bit flags
25 String: build, grow and search
26 &str, UTF-8 and characters
27 format! and format specifications
28 print!, println! and reading input
29 Vec: push, index and grow
30 Arrays and fixed-size buffers
31 Tuples and several return values
32 Enums with data
33 Option and its combinators
34 Result and the question mark
35 Traits and default methods
36 dyn Trait and dynamic dispatch
37 Generic functions and structs
38 Bounds, where clauses and impl Trait
39 Associated types and type aliases
40 Operator traits: Add, Index, Display
41 derive and marker traits
42 Composition instead of inheritance
43 Macros with macro_rules!
44 Macros that take many arguments
45 Procedural macros
46 Closures and captures
47 The Iterator trait
48 map, filter, collect and chains
49 Sorting and searching
50 HashMap and BTreeMap
51 HashSet and BTreeSet
52 VecDeque, LinkedList and their cost
53 BinaryHeap, stacks and queues
54 fold, sum, product and scan
55 Ranges and lazy sequences
56 Splitting and parsing text
57 Reading and writing text files
58 Bytes and binary files
59 Paths and directory walks
60 Parsing a file line by line
61 panics, unwinding and catch_unwind
62 Custom error types
63 The question mark through layers
64 assert!, debug_assert! and unreachable!
65 Unit tests with cargo test
66 Testing files and time
67 Debugging Rust with gdb
68 unsafe, raw pointers and undefined behaviour
69 Pointer arithmetic and ptr::read
70 size_of, align_of and repr
71 MaybeUninit and object lifetime
72 Calling C from Rust
73 Box: values on the heap
74 Rc, RefCell and shared mutation
75 Arc, Weak and reference cycles
76 Drop guards and custom cleanup
77 Allocation and a growable buffer
78 The global allocator
79 cargo build, run and check
80 Cargo.toml and dependencies
81 Cargo features
82 Workspaces and multiple crates
83 build.rs
84 Debug, release and profiles
85 Library crates and targets
86 cdylib and staticlib crates
87 Editions and modern Rust
88 Reading old Rust
89 Threads and join handles
90 Channels between threads
91 Mutex, Arc and shared state
92 Condition variables
93 Atomics and fetch_add
94 The memory model and orderings
95 Send, Sync and thread safety
96 Scoped threads
97 A thread pool
98 Producer, consumer and queues
99 async and await
100 Futures and a small executor
101 Iterators that keep state
102 Splitting work across threads
103 Instant, SystemTime and Duration
104 Dates and formatting
105 Random numbers
106 Regular expressions with regex
107 Arguments and exit codes
108 Environment variables and config
109 TCP clients and servers
110 Running other programs
111 Measuring performance
112 Profiling with counters and gdb
113 Cache, layout and false sharing
114 const fn and compile-time work
115 Hiding the implementation
116 Type erasure with dyn and Any
117 match instead of the visitor
118 Strategy at compile time and at run time
119 Observers and callbacks
120 Factories and builders
121 API design in Rust
122 no_std and embedded Rust
123 Capstone 1: a JSON tokenizer
124 Capstone 1: the parser
125 Capstone 1: a JSON value
126 Capstone 1: writing JSON
127 Capstone 1: testing the parser
128 Capstone 2: a task model
129 Capstone 2: saving tasks
130 Capstone 2: the command line
131 Capstone 2: error handling
132 Capstone 2: testing the tracker
133 Capstone 3: a tokenizer
134 Capstone 3: the inverted index
135 Capstone 3: queries and ranking
136 Capstone 3: measure and speed it up
Rust in Docker
Install Rust on FreeBSD
Install Rust on macOS
Install Rust on Rocky Linux
Install Rust on Ubuntu
Install Rust on Windows 11
python_extension/
(1)
Extending Python with Rust
rust_vs_cpp/
(25)
Rust and C++ side by side
Build tools: C++ and Rust
const and mut: C++ and Rust
constexpr and const fn: C++ and Rust
Enums and variants: C++ and Rust
Errors and exceptions: C++ and Rust
Functions, overloading and default arguments: C++ and Rust
Inheritance and traits: C++ and Rust
Iterators and algorithms: C++ and Rust
Macros and templates: C++ and Rust
Memory layout: C++ and Rust
Null and Option: C++ and Rust
Operator overloading: C++ and Rust
Ownership and moves: C++ and Rust
RAII and Drop: C++ and Rust
References and borrowing: C++ and Rust
Smart pointers: C++ and Rust
String views and slices: C++ and Rust
Strings: C++ and Rust
Structs and classes: C++ and Rust
Templates and generics: C++ and Rust
Testing: C++ and Rust
Threads and data races: C++ and Rust
Undefined behaviour: C++ and Rust
Variables and mutability: C++ and Rust