Sorry, but this is not good enough. This argument is made all the time, but all you're really saying is that every other language should be a second-class citizen to JavaScript. Emscripten is a cool technical hack, but why the fuck is it 2012 and we have to compile C++ to JavaScript?
It's not good enough now, probably because JavaScript was designed as a lightweight scripting language to make web pages a little more interactive and not as a general "bytecode for the web".
However, it always amazes me when people in discussions like this take JavaScript as a done deal or a static target...this is a fatal flaw in this discussion.
JavaScript as a language and community has evolved a lot, and it continues to evolve. We've already seen improvements that make it a better target for compilation, and we'll be seeing more in the future...now that it's clear that that is what the web wants/needs and not just a little scripting language for forms.
My bet is it will be much easier/quicker to work JavaScript into a good target for compiling other languages to than to develop a general VM and convince all the browser vendors to adopt it.
That's not even taking into account which would be better overall, which I think is an interesting question without an entirely clear answer....but I'm a pragmatist and so I think it's not worth worrying about except intellectually.
> all you're really saying is that every other language should be a second-class citizen to JavaScript.
Every platform has a "native" form. On your x86 desktop, it's x86 assembly, which everything is a second-class citizen to in the sense it needs to be compiled into it. On the web, the native form is JavaScript.
It has to be something fairly high-level because the web is CPU and OS-agnostic, which JS is.
The only practical concern that can be here, is whether JS is good enough for this task - if languages compiled into it run efficiently enough. It can be, if browsers continue to improve JS and if we all improve compilers into JS. So far little work has been done on both of those, but there is starting to be effort there.
> Emscripten is a cool technical hack, but why the fuck is it 2012 and we have to compile C++ to JavaScript?
We need to compile into something platform-independent, memory-safe and standardized. There isn't currently a better option than JavaScript, because each other option has major downsides. So does JS, to be sure, but overall it's a wash, and JS is already there so it wins.
Come on now, that's a bit harsh. There are really smart people who have been trying this exact thing for years without success. Microsoft tried harder than anyone to make "JScript" part of .NET but finally gave up and Windows 8 has 2 first-class VMs.
Without success because people like you have been fighting them every step of the way trying to hold back progress. It's hard to overcome inertia, and it's almost impossible when there is an organized resistance. It becomes absolutely insanity-inducing when said resistance uses its own success in warding off progress as ammunition for holding back progress.
I'd say I was exceedingly un-harsh, even downright polite, considering the long-term damage that has been inflicted.
Here is Python running in the browser:
http://syntensity.com/static/python.html