WebAssembly standard design has considered binary size optimization. The format itself is quite compact. But porting native code to Wasm often brings many large existing libraries which contain a lot of code which makes the binary large.
The native ecosystem never payed attention to binary size optimization, but the JS ecosystem payed attention to code size in the very beginning.
It's the fact that WASM in a browser provide very little. Anything you have there required to bring a bunch of things that JavaScript just has access out of the box. That include both, things like Fetch API and things like Garbage Collector.
> The native ecosystem never payed attention to binary size optimization, but the JS ecosystem payed attention to code size in the very beginning.
That's not true at all. Native ecosystem stopped paying attention to it outside of embed once storage/memory got relatively cheap (i.e. we went from kilo and megabytes to gigabytes). Native also gets to use shared libraries...sometimes.
JavaScript ecosystem is like pendulum, sometimes they care, sometimes they don't.
I have high hopes for components, both for reducing size and for avoiding JavaScript.
The native ecosystem never payed attention to binary size optimization, but the JS ecosystem payed attention to code size in the very beginning.