News for hackers. Stuff that matters.
Re:We rewrote our Rust WASM Parser in TypeScript – and it go... by nine_k on Friday March 20, 2026 @06:28PM (#47461566)
"We rewrote this code from language L to language M, and the result is better!" No wonder: it was a chance to rectify everything that was tangled or crooked, avoid every known bad decision, and apply newly-invented better approaches.

So this holds even for L = M. The speedup is not in the language, but in the rewriting and rethinking.

Re:We rewrote our Rust WASM Parser in TypeScript – and it go... by MiddleEndian on Friday March 20, 2026 @06:33PM (#47461631)
Now they just need a third party who's never seen the original to rewrite their TypeScript solution in Rust for even more gains.
Re:We rewrote our Rust WASM Parser in TypeScript – and it go... by nine_k on Friday March 20, 2026 @06:42PM (#47461730)
Indeed! But only after a year or so of using it in production, so that the drawbacks would be discovered.
Re:We rewrote our Rust WASM Parser in TypeScript – and it go... by azakai on Friday March 20, 2026 @07:49PM (#47462413)
You're generally right - rewrites let you improve the code - but they do have an actual reason the new language was better: avoiding copies on the boundary.

They say they measured that cost, and it was most of the runtime in the old version (though they don't give exact numbers). That cost does not exist at all in the new version, simply because of the language.

Re:We rewrote our Rust WASM Parser in TypeScript – and it go... by necovek on Saturday March 21, 2026 @05:16AM (#47465431)
It's doing copies and (de)serialization on both sides into native data types.

If they used raw byte structures, implemented the caching improvements on the wasm side, the copies might not be as bad.

But they still have an issue with multi-language stack: complexity also has a cost.

Python/C combo does not have this issue because you can work with Python types natively in C, but otherwise, this is a cross-language conversion issue, and not a Rust issue at all.

Re:We rewrote our Rust WASM Parser in TypeScript – and it go... by baranul on Friday March 20, 2026 @06:59PM (#47461935)
Truth. You can see improvement, even rewriting code in the same language.
Re:We rewrote our Rust WASM Parser in TypeScript – and it go... by awesome_dude on Friday March 20, 2026 @09:25PM (#47463110)
I think that they were honest about that to a degree, they pointed out that one source of the speed up was caused by the python fixing a big they hadn't noticed in the C++

Edit: fixed phone typos

Re:We rewrote our Rust WASM Parser in TypeScript – and it go... by rabisg on Saturday March 21, 2026 @03:01AM (#47464652)
One of the authors here. While that’s generally true, in this case it wasn’t time that helped us learn what worked. It was a nagging sense that the architecture wasn’t right, just days before launch, along with heavy instrumentation to test our assumptions.
Re:We rewrote our Rust WASM Parser in TypeScript – and it go... by johnisgood on Saturday March 21, 2026 @05:43AM (#47465587)
I have been saying this for a while now (thought it was obvious), and often I get downvoted when I point this out.