Mozilla's asm.js uses JavaScript to improve Web performance

21:56 Wednesday Jun 12, 2013


C and C++ apps get Web boost from a JavaScript subset that allows Web browsers to better perform optimization

With its asm.js project, Mozilla is promoting a subset of JavaScript intended to improve Web application performance and extend C and C++ applications to the Web.

Asm.js can be used as a low-level, efficient target language for compilers, according to the asm.js specification. Mozilla's goal has been to provide a high-performance target for applications written in low-level languages like C/C++, said Luke Wagner, a software engineer at Mozilla. By itself, asm.js does not make existing handwritten JavaScript faster, he said. "However, Web developers are very creative, and we expect them do a lot more with asm.js than just generation from C/C++." The Emscripten tool can compile C and C++ applications to asm.js, thus making them run faster.

"The key [to as.js] is a simple formal definition of the high-performance 'sweet spot,'" Wagner said. "This enables asm.js-generators like Emscripten, Mandreel, LLJS, and others to get a hard confirmation that they hit the spot. It also allows the browser's JavaScript engine to more easily and predictably perform aggressive optimization." Existing JavaScript engines can optimize this subset of JavaScript; asm.js proponents have already seen Firefox and Chrome achieve large speed-ups in a short time, said Wagner.

While asm.js has been cited for its usefulness in game development, enterprise applications also can benefit from it, JavaScript blogger Axel Rauschmayer said at the O'Reilly Fluent conference in San Francisco this week. He cites two main advantages of asm.js. "Advantage number 1, you get to compile existing C and C++ code -- and there's a lot of that code out there. You can compile it and run it very fast on the Web," Rauschmayer said. "The second advantage is that it's a neat compilation target for languages that are not JavaScript. You can more easily compile some languages so that they'll run on the Web platform and they'll run very fast."

Proponents of asm.js have planned additional Web APIs for compiling to asm.js in background threads and to store results of compilation offline. This would improve startup in future application loads.



< Back

    Add your comment

    We aim to have healthy debate. But we won't publish comments that abuse others

    1200 characters left





    © copyright 2013 Website News. All rights reserved.






    Website News is for and about the website design, development, marketing industry. We will endeavor to bring you up-to-date news and information to help you in your work as well as give you useful information and tips for your clients and their businesses.

    We are always keen for you to submit any information you find from elsewhere, or about your business, that you feel will be relevant.





    Contact Us:

    For advertising enquiries or to submit a story, please email us at:



    Website News

    Sign-up to Website News and create your universal Woogloo ID

    Your details

    Your login details

    Your address

    Is your address not being found?


    Company address

    Yes No

    To register on the Website News website you either need to use your
    exisitng Woogloo ID or create a new one (see below).

    Sign Up

    Why sign up?

    • Get access to Registered User's priviledges, which may include hidden pages, special features and special pricing, if they exist, on this website.
    • Get access to all sites powered by Woogloo V3 without having to enter your details everytime.

    Login Error

    Forgot your password?

    Enter your email address below and click 'Reset Password' Button

    What is a Woogloo ID

    Logging in...