Pages

Topics

Tools

↑↓navigate↵openescclose

All syntax guides

Short, practical guides on programming syntax, language fundamentals, and the tools developers reach for every day.

3,965 guides across 14 topics

Topics

Latest guides

3D illustration of token streams expanding into AST syntax trees through a macro hygiene filter
Rust

Rust Macros: macro_rules! Patterns, Hygiene, and Procedural Macros

Matcher fragments, repetition, hygiene and the proc-macro crate. How to read a macro_rules! error and when a derive macro is the right tool.

RustMacrosMetaprogramming
3D illustration of heap-allocated String buffers linked to borrowed UTF-8 fat-pointer slices
Rust

Rust Strings Explained: &str vs String, UTF-8 Indexing, and Conversions

Why s[0] does not compile, why slicing can panic, and when a &str becomes an owned String. The UTF-8 rules behind every Rust string error.

RustStringsMemory Management
3D illustration of contiguous Vec buffers, hash-bucketed HashMap tables and ordered BTreeMap nodes side by side
Rust

Rust Collections: Vec, HashMap, BTreeMap, and the Entry API

Vec for sequences, HashMap for keyed lookup, BTreeMap for order. Where the Entry API removes a lookup, and why index removal is O(n).

RustCollectionsData Structures
3D illustration of a Cargo workspace crate tree with module boundaries and public visibility gates
Rust

Rust Modules and Crates: mod, pub Visibility, use Paths, and Workspaces

Modules decide privacy, crates decide compilation, workspaces decide sharing. The file layout, visibility levels and Cargo wiring that hold them together.

RustModulesCargo
3D illustration of generic type parameters branching into specialised machine-code blocks with a where-clause filter
Rust

Rust Generics: Type Parameters, Where Clauses, and Monomorphization

How generics become zero-cost code, why where clauses are not cosmetic, and how monomorphization turns one function into many.

RustGenericsSyntax
3D illustration of future state machines queued for a work-stealing Tokio runtime scheduler with timer wheels
Rust

Rust Async Await: Futures, Pinning, and Tokio Task Execution

An async fn runs nothing until an executor polls it. Await points, Send bounds, blocking in a worker, cancellation and the runtime nesting panic.

RustAsyncTokio
3D illustration of worker thread lanes pushing messages through an mpsc pipe into a receiver guarded by a Mutex
Rust

Rust Concurrency: Spawning Threads, mpsc Channels, and Arc<Mutex<T>>

Ownership rules make data races a compile error. Sharing with Arc<Mutex>, sending with mpsc, and the lock ordering and sender-lifetime mistakes that hang.

RustConcurrencyMultithreading
3D illustration of algebraic enum variants nested in one container beside a struct field grid with method blocks
Rust

Rust Structs and Enums: Tuple Structs, Methods, and Algebraic Data Types

Struct is and, enum is or. Newtypes that stop argument mix-ups, receivers that decide ownership, and state machines where illegal states cannot be built.

RustData StructuresSyntax
3D illustration of a zero-cost iterator chain of map, filter and fold stations reducing a stream to one value
Rust

Rust Iterators and Closures: map, filter, and move Semantics

Iterators are lazy and monomorphised into loops. The three consumption forms, the Fn trait ladder, and why an adapter chain with no consumer does nothing.

RustFunctional ProgrammingIterators
3D illustration of heap Box containers, shared reference-counting rings and a RefCell borrow gate
Rust

Rust Smart Pointers: Box, Rc, Arc, and RefCell with Interior Mutability

Four pointers, four policies: single owner, shared single-thread, shared multi-thread, and a runtime borrow check. The cycles that leak and the panics that bite.

RustMemory ManagementConcurrency