est. 2018 · szczecin, poland ● availability: open — 1 retainer + 1 short build vol. viii — no. 42 · may 2026
late edition
EN·PL·
„Moin." Mein Deutsch reicht gerade fürs Essenbestellen, „die Karte, bitte" und „zahlen, bitte". Für alles Weitere — lieber Englisch oder Polnisch. 🍺

The Perliński Gazette

all the stack that's fit to ship
single issue
one email
§ a4 — notes from the workshopTechnology2026.02.18
← all dispatches

Rust + WASM for ML libraries: a year in


micro-ml is a tiny machine-learning and statistics library for JavaScript: 16 algorithms, zero runtime dependencies, 56KB gzipped. The core is Rust compiled to WebAssembly. A year in, here's what I'd do the same and what I'd never do again.

The bundle-size trap

WASM is not free. A naive wasm-bindgen build shipped a 400KB .wasm blob before I'd written a single algorithm. Most of it was panic-unwinding machinery and formatting code I never called. Setting panic = "abort", stripping debug info, and running wasm-opt -Oz got the binary down to something I wasn't embarrassed to put in someone's frontend.

wasm-bindgen footguns

Passing a Float64Array across the JS/WASM boundary copies it. Do that in a hot loop and you've built a library that's slower than the pure-JS version it was supposed to replace. The fix was to expose a thin handle API: allocate once, operate in WASM, read back once.

The real lesson: zero-deps is a hard sell

I assumed "16 algorithms, zero dependencies, 56KB" would sell itself. It didn't. JavaScript developers don't want a Rust toolchain in their build, and they're right not to. Shipping prebuilt artifacts, an honest size badge, and a copy-paste example that runs in the README did more for adoption than any benchmark.