News for hackers. Stuff that matters.
Re:Ask HN: Why not fix JavaScript? by phamilton on Monday April 18, 2011 @02:58AM (#2458258)
I think it would be interesting though, for browsers to implement a Javascript VM which would allow compilations to byte code from any supported language, rather than source to source translations. Similar to the many languages that compile to run on a JVM (JRuby, Jython, Scala, etc.)
Re:Ask HN: Why not fix JavaScript? by bad_user on Monday April 18, 2011 @04:46AM (#2458426)
Javascript is very dynamic, and it is a decent target from any source language.

And although it would be really cool, I wouldn't want a browser bytecode, because it would make Javascript harder to optimize, while also not improving too much the lives of language developers.

You're mentioning the JVM, but there's a problem with that example. The JVM is freakin' heavy, and optimizations are parts of that. Google had to come up with their own bytecode for Android to lighten the pipeline for mobile phones, and Rhino is a lot worse performance-wise than V8 -- there is not such thing as a language-neutral VM / bytecode that's also efficient. Go ask the developer of Lua-JIT about it ;)