Wednesday, April 29, 2026

TypeScript faster than Rust=>WASM ?!

Rewriting our Rust WASM Parser in TypeScript | OpenUI.

...openui-lang parser in Rust and compiled it to WASM. The logic was sound: Rust is fast, WASM gives you near-native speed in the browser, and our parser is a reasonably complex multi-stage pipeline. Why wouldn't you want that in Rust?

Turns out we were optimising the wrong thing.

End result: 2.2-4.6x faster per call and 2.6-3.3x lower total streaming cost.