> Most JavaScript runtimes no longer interpret JavaScript.
Yes, JavaScript implementations have been more or less JIT-compiler based for quite some time now. But they are still quite far behind in performance and this does not address the real time requirements at all (in fact, it makes it worse). There's also a significant memory hit from having the JIT compiler around.
Asm.js is cool because it can be compiled to native code ahead of time (addresses the performance gap at the expense of startup time), but this project isn't talking about Asm.js at all. It's about running human-written JavaScript as opposed to Asm.js which is intended to be emitted by compilers.
I would personally have preferred Lua via eLua or LuaJIT over Javascript.
And I don't know where he got his stat about "Most JavaScript runtimes no longer interpret JavaScript". And I don't see a single thing backing that up.
This post and its parent make a lot of bad assumptions. For one, performance is not the same thing as real-time nor is performance the same thing as fast.
Real-time means that a given system has verifiable (and often guaranteed) run time qualities. Time being the keyword. Saying "System X's slowest operation completes in 500ms" is a definition of a real-time system.
Performance is a system's ability to complete a certain task in a certain amount of time. "System X can toggle an I/O pin in 10ms."
A good analogy is the comparison of a high-end sports car (Porsche 911) and a Big Rig. Unloaded, the sports car can travel 140MPH (fast!), while the Big Rig can travel 75MPH. Fully loaded, the Porsche can carry 800 lbs and travel at 90MPH, while the Big Rig can carry 12,000 lbs and travel at 75MPH. If you system's goal is to move 12,000 lbs of cargo 75 miles, the Big Rig would have higher performance and better real-time qualities (more cargo transferred per hour and a consistent time of 1 hours) while the Porsche would have poorer performance and real-time qualities.
Secondly, asm.js is not compiled to native code ahead-of-time (yet). No compiler (that I'm aware of) generates native for a JavaScript input. SpiderMonkey previously supported XDR[1], Rhino supports compiling to Java class files for most JS[2], and Google V8 supports compiling to "snapshots"[3] (a sort of pre-parsed, semi-compiled form, with the heap linked into the data structure).
Thirdly, Espruino is written by Gordon Williams and based on the things he learned while developing Tiny-JS[4].
Real-time means that a given system has verifiable (and often guaranteed) run time qualities. Time being the keyword. Saying "System X's slowest operation completes in 500ms" is a definition of a real-time system.
Performance is a system's ability to complete a certain task in a certain amount of time. "System X can toggle an I/O pin in 10ms."
A good analogy is the comparison of a high-end sports car (Porsche 911) and a Big Rig. Unloaded, the sports car can travel 140MPH (fast!), while the Big Rig can travel 75MPH. Fully loaded, the Porsche can carry 800 lbs and travel at 90MPH, while the Big Rig can carry 12,000 lbs and travel at 75MPH. If you system's goal is to move 12,000 lbs of cargo 75 miles, the Big Rig would have higher performance and better real-time qualities (more cargo transferred per hour and a consistent time of 1 hours) while the Porsche would have poorer performance and real-time qualities.
Secondly, asm.js is not compiled to native code ahead-of-time (yet). No compiler (that I'm aware of) generates native code for a JavaScript input. SpiderMonkey previously supported XDR[1], Rhino supports compiling to Java class files for most JS[2], and Google V8 supports compiling to "snapshots"[3] (a sort of pre-parsed, semi-compiled form, with the heap linked into the data structure).
Thirdly, Espruino is written by Gordon Williams and based on the things he learned while developing Tiny-JS[4].
> This post and its parent make a lot of bad assumptions. For one, performance is not the same thing as real-time nor is performance the same thing as fast.
Yes, this is exactly why I mentioned real time and questioned the suitability of garbage collection for this use. Overall performance is a secondary issue, many use cases can work with slightly lower perf but in microcontrollers you want predicatable performance.