Slashdot Mirror


Emscripten and New Javascript Engine Bring Unreal Engine To Firefox

MojoKid writes "There's no doubt that gaming on the Web has improved dramatically in recent years, but Mozilla believes it has developed new technology that will deliver a big leap in what browser-based gaming can become. The company developed a highly-optimized version of Javascript that's designed to 'supercharge' a game's code to deliver near-native performance. And now that innovation has enabled Mozilla to bring Epic's Unreal Engine 3 to the browser. As a sort of proof of concept, Mozilla debuted this BananaBread game demo that was built using WebGL, Emscripten, and the new JavaScript version called 'asm.js.' Mozilla says that it's working with the likes of EA, Disney, and ZeptoLab to optimize games for the mobile Web, as well." Emscripten was previously used to port Doom to the browser.

11 of 124 comments (clear)

  1. Chrome by The+MAZZTer · · Score: 4, Informative

    Looks like Chrome is looking to do this as well.

  2. "new JavaScript version called 'asm.js.'" by K.+S.+Kyosuke · · Score: 5, Insightful

    Asm.js is *not* a "new JavaScript version". Asm.js is to JavaScript what Squeak Slang is to Smalltalk, what Richard Kelsey's Pre-Scheme is to RxRS Scheme, and, more remotely, what RPython is to Python (although RPython is much richer in comparison with the other restricted languages, and really not all that JITtable - the translation process is very slow).

    --
    Ezekiel 23:20
  3. Re:I don't care by wierd_w · · Score: 4, Insightful

    I've ued 64bit builds of nightly for some time now.

    The issue is getting plugins to play nice.

    You can't really blame Mozilla for not wanting to jump the shark, when they will catch all the flames for plugin makers who refuse to make their plugins 64bit friendly.

    Right now, it's "whaaaaaa! I want 64bit builds!"

    They offer a 64bit build, and then its "whaaaa! Flash plugin doesn't work! Noscript doesn't work! Adblock Plus doesn't work! Its horrible, and it crashes to boot!"

    The market has to build up enough pressure to push out the colonic obstructions in the way of 64bit adoption as the new standard. It will take awhile.

  4. Re:Remember the good old days? by Pieroxy · · Score: 5, Informative

    What happened to seeing a grid of 80x25 characters on a black background? Progress.

  5. Re:Hot Dog! by Anonymous Coward · · Score: 4, Funny

    Javascript is to Java as a smart person is to you.

  6. 64-bit gives better security by pavon · · Score: 4, Informative

    Plus, there is no real advantage to using a 64-bit browser unless you want it to use more than 2gb of memory

    ASLR (Address Space Layout Randomization) is far more effective in a 64-bit address space than in a 32-bit address space. Browsers need all the layers of protection they can get from exploits.

    On the other hand, WebGL gives any website in the world nearly direct access to exploit bugs in GPU drivers, significantly increasing the attack surface of the browser. I say nearly, because the browser does check all parameters for possible buffer overflow conditions before passing them onto OpenGL calls, but any other type of exploit is still possible.

    I would definitely prefer that Firefox prioritize features that increase security over those that decrease it.

  7. Re:I don't care by Enderandrew · · Score: 4, Informative

    64-bit browsers are inherently more secure, and can access more memory. Native 64-bit apps also run faster. You're trying to call someone an idiot without realizing that you don't know what you're talking about in claiming there are no advantages.

    http://arstechnica.com/information-technology/2012/11/64-bit-firefox-for-windows-should-be-prioritized-not-suspended/

    --
    http://blindscribblings.com - Tasty pop-culture in conceptual fashion.
  8. Re:Javascript engine evolution by Anonymous Coward · · Score: 5, Interesting

    I suspect the security concerns about WebGL are overblown. The code that runs on the GPU are vertex and fragment shaders. The shader language is very limited and exposes only a small surface between the host and the GPU. You can load/compile shader code, assign uniforms/attributes, share frame buffers and textures and that's about it. It's not as though the coder gets unfettered access to the entire DirectX stack.

    Both firefox and chrome sanitize shader code so shaders can't play with whatever unsafe features some GPU might implement. One strength of WebGL (and OpenGL ES that's it's based on) is that the fixed function OpenGL API is gone; everything is done with shaders. That means the huge user-land fixed function API is gone and you're left with a simple API that just loads shader code and data (vectors, textures etc.) So the user-land attack surface is relatively small.

    Vulnerabilities have been found in individual drivers but they've been few and fixed quickly. WebGL exploits are highly unlikely to be portable; they'll attack certain versions of GPU+drivers on certain OSs... broadly successful exploits won't be feasible.

  9. Re:Javascript engine evolution by buchner.johannes · · Score: 5, Informative

    Ah, my mistake. "use asm" is a proposed Javascript feature:

    ... asm.js, a strict subset of JavaScript that can be used as a low-level, efficient target language for compilers. The asm.js language provides an abstraction similar to the C/C++ virtual machine: a large binary heap with efficient loads and stores, integer and floating-point arithmetic, first-order function definitions, and function pointers.

    http://asmjs.org/spec/latest/
    Also interesting:

    You could write your programs in Asm.js, but the idea is that you will use other languages that compile to Asm.js. This opens up the possibility of converting existing desktop apps to run in the browser. Emscripten, for example, is a compiler that converts the LLVM bitcode intermediate language to either JavaScript or the asm.js subset.

    http://www.i-programmer.info/news/167-javascript/5694-firefox-runs-javascript-games-at-native-speed.html

    --
    NB: The message above might reflect my opinion right now, but not necessarily tomorrow or next year.
  10. Re:Not me by Mr.+McGibby · · Score: 5, Insightful

    That's fine. Plenty of people are doing it already. So nobody that matters really cares what you think.

    --
    Mad Software: Rantings on Developing So
  11. Re:Remember the good old days? by tibman · · Score: 4, Insightful

    "them" could be anyone, including you. Spinning up Apache is something any beginner developer can work through. Or even better, just pay 3$ a month for a place to host your stuff. Now you are one of "them". I understand your argument but it's like saying we shouldn't use wikipedia because they could nuke the website tomorrow to spite us. I don't want to go back to Encarta on a CD.

    --
    http://soylentnews.org/~tibman