Structures held to
a second opinion.
Ten families of containers, queues, trees, caches, sketches and text algorithms for MoonBit, bound as one module. Each is accompanied by reference values computed twice, by two other standard libraries, and admitted only when those two agree.
Every specimen in the Workbench is the library itself, compiled to WebAssembly and instantiated in this tab — not an illustration of it.
The Workbench
IndexMap
What this calls
The Ten Families
The Assay
Answers computed twice
Each family's reference values are produced independently by the Python standard library and by Rust's, then compared byte for byte. Nothing is committed until both agree.
Mutation tested
Two key lines per family were broken deliberately — comparisons, bounds, renumbering, expiry — and each break turned the suite red before it was reverted.
The same tests everywhere
Wasm, wasm-gc, JavaScript and native run the identical suite, so no structure is allowed to drift on one target and pass on another.
The Reference
Instruction
Add the module
moon add moonbitstack/moonstl — the only dependency is MoonBit's own seed package.
Import a family
Packages are separate: bring in map, heap, tree,
cache, sketch, seq, text,
phf, algo or spec — and nothing else follows.
Run it anywhere
Wasm, wasm-gc, JavaScript and native. Capacities and orderings are explicit arguments, and fallible constructors raise rather than abort.