3 ms·
The thing that I think people are getting confused about is, even though asm.js is faster, you actually don't need asm.js to get native code running the browser
by ilaksh 14y ago
The thing that I think people are getting confused about is, even though asm.js is faster, you actually don't need asm.js to get native code running the browser. The new engines in Chrome and Firefox already compile to native code.
Asm.js is just a way to ensure that your code always get optimized as much as possible.
I really don't think that asm.js is necessary to bring 3d gaming to the web. WebGL performs very well as long as you take advantage of the graphics hardware. I'm not a fan of asm.js actually, since if I wanted to write low-level code I would just stick with C++. I'm on the web to take advantage of things like JavaScript and CoffeeScript.
I think the way to get to the sweet spot for 3d gaming and applications in the browser is to 1) make sure that WebGL is well supported on as many platforms as possible and 2) take advantage of the built-in networking, instant-on factor, openness, general webiness, and scripting capabilities of the web platform. By 'instant-on factor' I mean that games can load up very quickly after hitting a URL. By 'general webiness' I mean, for example, you can start a game at the end of the work day, later the evening continue from your house -- you aren't tied to a particular machine. Also the web has all of the HTML5 features which could really come in handy for innovative browser-based operating systems or 3d applications.
Also, if you take advantage of things like procedurally generated textures and geometry, people won't even have to wait for stuff like loading textures.
Asm.js is cool but its not really necessary and not my thing. We just need good WebGL support.
Another feature that 3d browser-based games and applications could take advantage of is WebRTC.
The point being that if you take advantage of easy-to-use web APIs and libraries like WebWorkers, WebRTC, Three.js, CopperLicht, web-based languages like CoffeeScript, etc. then the web platform can offer game developers productivity advantages.
- macspoofing 14y ago>I really don't think that asm.js is necessary to bring 3d gaming to the web. It helps ... a lot. WebGL gives you GPU access which will largely drive your graphics engine, but there's still tons of places where CPU performance matters (e.g. physics and AI). Asm.js and WebGL are complementary. >I'm on the web to take advantage of things like JavaScript and CoffeeScript. And asm.js prevents this how? If you're coding in CoffeeScript, you already have a necessary compile step to do. Are you telling me you wouldn't want the CoffeeScript compiler to give you extra performance by including asm.js heuristics?
- ilaksh 14y agoYeah there are tons of places that CPU performance matters, but my point is that Mozilla and WebKit's engines are doing a good job of native compilation already. If you could make a CoffeeScript compiler that would output asm.js, then great. But I'm not sure that's possible. I think that you either have to go from C/C++ code through the emscripten or right directly using the asm.js stuff in JavaScript.
- BruceM 14y agoOr LLJS: http://jlongster.com/Compiling-LLJS-to-asm.js,-Now-Available- http://jlongster.com/Compiling-LLJS-to-asm.js,-Now-Available...