Mini Actor framework visualized in a night coffee shop: Actor, Addr, Inbox, Supervisor

Build Your Own Mini Actor Framework: Run Concurrency Like a Coffee Shop

Using a coffee shop metaphor, build a practical mini Actor framework in Rust covering Addr, spawn, supervise, a registry, and message passing.

August 21, 2025 · 6 min · 1137 words · Rexai Programming

Rust unsafe isn’t a toy — it’s a blood oath: 6 YOLO mistakes that will blow up your code

Friend, have you had a night like this? On the screen, the Rust compiler’s scarlet errors grip your project by the throat. Lifetimes, ownership, borrow rules — the guardians you’re usually proud of suddenly feel like a never-ending lecture you just want to shut up. Right when you’re about to give up and smash the keyboard, a word glows in your mind with devilish temptation — unsafe. It feels like a cheat code, a God-mode switch that makes all red squiggles vanish. You wrap those “problematic” lines inside a sacred block, type cargo build… Success! Silence. ...

August 13, 2025 · 6 min · 1278 words · Rexai Programming
The difference between Tokio tasks and OS threads

Stop treating tokio::spawn as a thread! I launched 1000 tasks in 2 seconds and the system stayed calm

Follow Rexai Programming on WeChat to learn Rust the easy way. Forget the heavy “thread” mental model from your OS class. Today, I’ll show you a delightful trick about Tokio. You think tokio::spawn creates a thread? Nope. It gives you something smarter, lighter, and frankly a little sneaky: the ability to harness massive concurrency at a shockingly low cost. This is one of Rust’s secret weapons in backend development. Ready? Let’s reveal the trick. ...

August 11, 2025 · 4 min · 818 words · Rexai Programming
Rust async is compiled into a state machine and driven by Future, poll, and Waker

Rust Async State Machine, Unmasked: How Future, poll, and Waker Really Work

Your Rust async code is a “liar”—and I’m going to strip its state machine down to the bones. Have you ever written an async function, happily called it, and then… the program just ended with nothing happening? You stare at the screen: Where did my code go? Where’s my println!? Did I just run emptiness? Don’t panic. You’re not alone. Welcome to the world of Rust async, where the first rule is: what you see isn’t necessarily what’s happening. ...

August 10, 2025 · 4 min · 770 words · Rexai Programming