3 ms·
Is it a workaround that your CPU doesn't run C++ code directly and instead runs assembly, and a compiler is needed to convert C++ to assembly? The answer is ob
by grimlck 15y ago
Is it a workaround that your CPU doesn't run C++ code directly and instead runs assembly, and a compiler is needed to convert C++ to assembly?
The answer is obviously no, so how are 1) and 2) any different? I think they are great things - they encourage competition and allow for much more rapid progress than if there were a single monolithic framework and language that everyone was forced to use. Trying to create a single perfect platform that makes everyone happy is an impossible task.
- phamilton 15y agoI 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.)
- bad_user 15y agoJavascript 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 ;)