[JSConfUS 2013] Brendan Eich: Toward a language-neutral browser VM
JavaScript has a yin and yang, or put another world-religion way, it serves two masters: humans who hand-code apps and libraries, and compilers that generate JS as virtual machine code. No language can serve two such masters for long. Consider C, still hand-coded, used only as a target language "temporarily", a la early C++'s cfront. Which one will win with JS? I think hand-coding is closer to God, make no mistake, but I'm concerned about the case that mammon will prevail in the longer run. In this dystopia, hand-coding will die hard, but compilers can out-generate humans and relieve programmers from having to learn and use JS, especially when they know and prefer another language, and definitely (as in the case of 3D games) when they have C++ code to port. Just as in the story of John Henry vs. the Steam-Powered Hammer, a noble human may get ahead in a sprint, but end up dying after the finish line from a burst heart. I will present demos of compiled-to-JS programs including 3D games. I'll then do quick dive into the asm.js (http://asmjs.org/) subset of JS generated by Emscripten, and the OdinMonkey all-at-once asm.js compiler built into Firefox's SpiderMonkey engine. I will also present near-term extensions for data and task parallelism in JS. Finally, I will discuss code size and memory use, and sketch how hand-coded and compiler-generated JS can be linked together and share references into one anothers' heaps.