Simple diet tricks for asm.js
floooh.github.io
floooh.github.io
2 other points I'd add to this overall:
1) Can't emphasize enough how bad exception support is for size, expect in the neighborhood of 30% size increase. This is due to needing to handle all of the possible ways functions can return. Even with exception support disabled, you can still throw them, you just can't catch them in C++ land.
2) goto's. There's a few good reasons to use these, especially in code that needs to make sure cleanup code always runs. Emscripten supports that with a couple different code constructs, pretty much all of which cause a significant amount of bloat. We've saved ~100k in some cases by specifically targeting some 3rd party code that made use of them and rewritting them to not have gotos.
Is something printed in the console under emscripten if an exception is thrown?
This is because JavaScript is alpha-numeric and is easier to compress than binary. There are a relatively 'small' number of characters in the alpha-numeric range, so they can be mapped together easier than the wider range of binary data.
I don't see a need for this since WebAssembly will provide a polyfill.
Why evolve a language if you can't use any the new features?