// the find
skyzh/type-exercise-in-rust
Learn Rust dark magics by implementing an expression framework in database systems
A structured tutorial that teaches advanced Rust type system techniques by building an Arrow-like columnar expression framework from scratch, day by day. It's aimed at Rust developers who already know the basics and want to understand how production database engines like RisingWave and Databend handle vectorized expression evaluation. The author built these exact patterns in real systems, so this isn't toy pedagogy.
The progression from concrete to abstract is well-designed — you implement Array/Scalar traits before macros obscure what's happening, so the abstractions earn their complexity. GAT usage is explained through actual compiler bugs the author hit, which is more educational than a clean tutorial that pretends the rough edges don't exist. Each day has clear before/after code showing exactly what problem the new abstraction solves. The real-world lineage (RisingWave, Databend, TiKV coprocessor) means the patterns aren't invented for the tutorial — they're battle-tested.
The hard-way path for Day 6 is now crossed out because a compiler bug was fixed, which leaves a zombie section that's confusing without close reading. Days 9–10 and the planned aggregator Day 11 feel undercooked — Day 9 is a stub and the TBD section just stops. The tutorial is written primarily for readers who already have Rust experience and database internals familiarity; someone coming in just to learn Rust will be lost by Day 3. The mdBook tutorial and the actual code aren't always in sync, so you sometimes need to read both in parallel to follow what's happening.