The same WCA Average-of-5 algorithm, written in seventeen languages. Watch each language handle "DNF" — that "value doesn't exist" case is a litmus test for any type system.
The WCA Ao5 rules (in 60 seconds)
Cuber attempts the event 5 times; each result in centiseconds
Drop the fastest and the slowest attempt
Arithmetic mean of the remaining 3 = Ao5
A DNF (Did Not Finish) sorts to the very end — it gets dropped as the "slowest"
But with ≥ 2 DNFs, the whole Ao5 itself becomes DNF
Seventeen languages, four distinct answers to "value doesn't exist": union types (TS number | null / PHP ?int), Option / Optional / Maybe (Rust / C++ / Swift / Kotlin / Zig / Python / Java's boxed null / Mojo's Optional[Int] / C# int? / Haskell Maybe Int), sentinel values (C / Go / Lua using -1), and no type guard at all (JS / Ruby). The first two surface unhandled DNFs at compile time; the last two need tests to catch — JS / Ruby are the foil to TS here.
Where do empties sort to
Kotlin in one line: compareBy(nullsLast()). Ruby sort_by in one line. Python in one lambda key. Haskell with comparing (maybe maxBound id) in one line. Rust takes a four-arm exhaustive match. Zig wraps it in an inline struct. Same semantics, 5× variance in line count — the real "language density" gap.
Higher-order vs imperative
Python / Swift / Kotlin / TS lean on filter / map / reduce / sorted chains in a pipeline style; C and Zig still go imperative with for loops and scratch arrays. Rust sits in between — iterator chains or imperative, both feel native.
Errors / boundary handling
WCA rules demand exactly 5 attempts. Rust / Zig / C++ guarantee this with fixed-size array types like [Time; 5] — too few args, won't compile. Python / TS use list, so they need a runtime assert.