emscripten generates very similar code from LLVM bitcode which in turn was generated (optimized) from say C or C++.
It's next to impossible to emit such code from language that is not statically typed.
Also it's not necessarily going to be faster than handwritten "human" JavaScript. There are a lot of factors in play. That's exactly what I am trying to stress in the blog post.
I think the OP was suggesting that another language could be used for this purpose, similar in function to CoffeeScript in that it compiles down to JavaScript, but statically typed (or even just straight C). That way most of your app could be written in CoffeeScript or JavaScript, but for those few functions who's performance REALLY matters, you could reach for a different tool that makes writing this inhumane but performant flavor of JavaScript easy.
It's an interesting idea, and having little to no knowledge of compilers, I'd be interested in your take on it. Could emscripten already be used for something like this?
It's next to impossible to emit such code from language that is not statically typed.
Also it's not necessarily going to be faster than handwritten "human" JavaScript. There are a lot of factors in play. That's exactly what I am trying to stress in the blog post.