4 ms·
Firefox OS takes the view that the system you are writing to is the browser. It is the OS you are running. From that world-view, writing a JIT would mean writ
by jgon 12y ago
Firefox OS takes the view that the system you are writing to is the browser. It is the OS you are running. From that world-view, writing a JIT would mean writing a compiler that outputs asm.js and then executing that outputted code. So if Google modified V8 to have different backend they could definitely run it on Firefox OS. This would be the same process they would need to do to port it to another system, ie modify the JIT to output different types of machine instructions to execute. It just so happens that in this case the machine the instructions are for is the Javascript VM.
Apple's case, if I understand, is different, because you cannot generate code at runtime and hence you cannot compile something "just in time". Nothing about Firefox OS disallows this, and so the two situations are not comparable
- Someone 12y agoAFAIK, iOS JavaScript has eval(), so you are free to run Firefox on iOS in the browser in the same way you can run Chrome on Firefox OS or Linux on iOS (http://bellard.org/jslinux/ http://bellard.org/jslinux/ boots in 10.4 seconds on my iPad).
- jgon 12y agoWell it's not really the same. Firefox OS is literally the OS. Demanding that Chrome be allowed to run their C++ code would be like demanding that Google makes it so that Firefox OS can be installed on Android phones, replacing the Android system. They don't do that, instead they offer up to developers the same facilities to write their apps that they reserve for their own apps. GMail for Android is written using the same language and APIs that you can use for your own application. Firefox OS is providing the same thing. They don't allow you to just replace the OS, which in this case is the browser, but all applications, including their own are written with the same APIs available to you the developer. They aren't writing some of their own apps in C++ and then demanding everyone else write in Javascript. Apple is writing their own JIT and then demanding that everyone else interpret, which is not at all equivalent. The difference here is that the browser is the OS. So the OS is at a certain level which you cannot replace or step into willy nilly. Think of it like Windows enforcing Hardware access through its drivers, not allowing you to just send whatever you want to someone's disk drive and possibly do damage to the device. In the same way, they enforce a level of Memory protection through the runtime, and after that they are on the same footing as you. We accept these constraints when we run OSs all the time, and I don't see it as being much different here.