Hacker News new | ask | show | jobs
by kbenson 3077 days ago
Wow, I had assumed a lot more of the Rust runtime/stdlib would need to come along with anything, but the wasm-unknown-unknown target and aggressive culling of unused code looks to make this really competitive. That's awesome, and I'm really happy to have my predictions and assumptions proven wrong. :)

Edit: Some of the numbers:

Original JS: just under 30,000 bytes.

Closure compiler minified JS: 8,365 bytes.

New combined JS and WASM: 20,996 bytes

Roughly half of the WASM output is JS and half of which is WASM, since not all components in the original JS were replaced, just a specific subset. There is some duplication of functions that both the remaining JS still uses and the new WASM code does as well. Rust diagnostic and error messages appear to still be present inthe data section although unusable, so could be cleared out with better tooling.

1 comments

The smallest file we've gotten so far is 116 bytes. I went over it here https://www.reddit.com/r/programming/comments/7fn87w/rust_wa...