3 ms·
> That being said, I would very much welcome a high-performance alternative to Javascript that also runs in any browser -- something in the spirit of C or Java,
by breckinloggins 13y ago
> That being said, I would very much welcome a high-performance alternative to Javascript that also runs in any browser -- something in the spirit of C or Java, which could be embedded in Javascript and vice versa.
Possible steps in that direction:
- Google Native Client: run native code in a sandbox [1]
- asm.js: A strict subset of JavaScript that can be optimized to native or near-native speed [2]
I much prefer the asm.js approach. I agree that there's a need for NaCl, but if we look at the browser as a sandboxed virtual machine that everyone has, we should all agree on a bytecode specification for that virtual machine. We pick JavaScript "because it is there". Once all browsers speak native asm.js, then you can compile your client-side code in whatever language you want, even C/C++ (see Emscripten for example). [3][4]
[1] https://developers.google.com/native-client/ https://developers.google.com/native-client/
[2] https://blog.mozilla.org/mbest/2013/06/25/asm-js-its-really-fast-backwards-compatible-and-now-in-the-release-version-of-firefox/ https://blog.mozilla.org/mbest/2013/06/25/asm-js-its-really-...
[3] https://github.com/kripken/emscripten https://github.com/kripken/emscripten
[4] http://games.slashdot.org/story/13/03/28/2113234/emscripten-and-new-javascript-engine-bring-unreal-engine-to-firefox http://games.slashdot.org/story/13/03/28/2113234/emscripten-...