Tag
#rust
14 posts
rustnew
Showing real terminal output in a post, not paraphrasing it
A new fence type renders actual captured rustc/cargo output — colored by severity, through the reader's own theme, not a screenshot.
Writing a lock-free queue from scratch
The ABA problem, pointer tagging, and CAS — by building it in Rust.
Crafting a parser, part 1: from source to tokens
Before any grammar rule runs, a lexer turns characters into spanned tokens — and that token shape decides everything downstream.
Reclaiming memory: hazard pointers vs epochs
Once the queue works, the hard part begins — freeing nodes safely.
Crafting a parser, part 2: grammars and recursive descent
One function per grammar rule, the call stack as the parse tree, and why left recursion is a trap.
compilersPart 3
Crafting a parser, part 3: designing the AST
Enums all the way down, spans on every node, and keeping semantics out of the syntax tree.
compilersPart 4
Crafting a parser, part 4: Pratt parsing and precedence
One loop and a binding-power table replace a forest of precedence functions.
rust
Tokio's cooperative scheduler: budgets, yields, and starvation
Async Rust isn't preemptive — long polls block everyone on the same worker.
compilersPart 5
Crafting a parser, part 5: error recovery and diagnostics
Report many errors per run and keep a usable tree — panic-mode recovery, sync points, and messages that don't lie.
compilersPart 6
Crafting a parser, part 6: ambiguity, lookahead, and the lexer hack
The dangling else, the less-than-versus-generics problem, and how much backtracking is honest.
compilersPart 7
Crafting a parser, part 7: resilient, incremental parsing
IDE-grade parsing: lossless trees, errors as the normal path, and reparsing only the edited subtree.
rust
Pin and self-referential structs in Rust
Why `Pin<&mut T>` exists, and when your future really needs it.
compilersPart 8
Crafting a parser, part 8: testing, snapshots, and fuzzing
Snapshot the tree, round-trip for fidelity, and fuzz to enforce the never-panic contract.
rustPart 3
Memory ordering in practice (not the spec)
Acquire, release, and when Relaxed is actually fine on hot paths.