Jump to content

Google shows interest in Mozilla's ASM.js


nsane.forums

Recommended Posts

nsane.forums

A Chrome programmer seeks support for a new Mozilla technology to bridge the C and JavaScript languages -- even though Google has competing ideas.

pBD4Xjg.png

Some low-level benchmarks show ASM.js software outperforming ordinary JavaScript in both Firefox and Chrome, and coming close to the speed of native software.

At least some at Google want to embrace a Mozilla-backed project to speed up Web apps written with JavaScript -- even though it competes directly with Google's own Native Client and Dart programming technology.

Mozilla has been working for months on a technology called ASM.js, which it hopes will boost JavaScript performance, especially in combination with a related Mozilla-spawned technology called Emscripten. JavaScript powers Web apps such as Google Docs, and ASM.js is a special "extremely restricted" subset of the programming language that's designed to make it easier for developers to bring existing software written in the C programming language to the Web.

Yesterday, Mozilla held a coming-out party for ASM.js, announcing a cooperation with Epic to bring its Unreal game engine to ASM.js. The same day, Google effectively announced a plan to support it within Chrome's V8 engine that processes JavaScript.

"Optimizations should be added to V8 to generate good code for the ASM.js subset of JavaScript," Chrome programmer Kenneth Russell said in a Chrome feature-tracking item for ASM.js. "The implementation cost should be small compared to the potential upside -- the ability to run significant existing code bases with close to the speed of C inside the JavaScript engine."

Securing support from other browser makers is crucial to the success of a programming technology. Without that support, programmers can only target a single browser, which undermines the advantages of universality that the Web can offer.

Google didn't respond to a request for comment about its position on the matter.

Browser makers often ally to bring a new technology to market and to help coax Web programmers to use it. What's particularly notable about Google's support is that the company already has other competing projects well under way.

The C language is often used for programs like streaming-media codecs and video game physics engines, but today's browsers can't use modules written in C unless it's packaged as a browser plug-in. And increasingly, plug-ins are frowned upon because they're inconvenient to install and maintain, a security risk, and sometimes a problem for processor and battery usage.

Thus, Web developers are striking out in new directions such as ASM.js to find better ways to let browsers handle C software.

For Google, it's Native Client (NaCl) and its sibling Portable Native Client (PNaCl). This software runs a restricted set of C instructions, compiled from the original source code using special tools, and runs it in a special protected sandboxed area. C developers must adapt their software for Native Client's restrictions, but Google argues that in many cases the change is very easy, and indeed some games on the Chrome Web Store use Native Client.

Another project, less directly competitive, is a Google programming language called Dart. With it, Google hopes for a better alternative to JavaScript.

Neither NaCl nor Dart, though, has much support outside Google. No other browser makers have shown any enthusiasm for either technology, and in some cases they've been downright hostile, as in the case of Mozilla opposing NaCl and Microsoft bad-mouthing Dart. Adding new programming foundations to the Web is a very big deal, since significant developer adoption means that all browsers forever must support that foundation alongside others. And as a technical matter, supporting multiple programming foundations running simultaneously is fraught with technical complexities.

Google hopes that with NaCl, it can get browser-executed software downloaded over the Net to run with performance that's within a few percentage points of native code. Mozilla's Emscripten and ASM.js projects promise nothing close to that -- but also don't require a profound rewrite of the Web programming stack.

"It's early to say, but our preliminary benchmarks of C programs compiled to ASM.js are usually within a factor of 2 slowdown over native compilation with clang," the ASM.js FAQ says.

A compiler's job is to change software written by humans in a high-level programming language into the lower-level software a computer can understand. In the case of Emscripten, it compiles C only to ASM.js JavaScript, and the browser itself handles conversion of that software into the truly native instructions for a processor to execute. By using ASM.js, though, Mozilla expects to have much higher performance than with the ordinary, broader set of JavaScript instructions.


view.gifView: Original Article

Link to comment
Share on other sites


  • Replies 9
  • Views 2k
  • Created
  • Last Reply

google will finally get this Tech (put some $$$ :D ) and again FF will loose in browser racing :P

Link to comment
Share on other sites


google will finally get this Tech (put some $$$ :D ) and again FF will loose in browser racing :P

Don't think so, google has done a lot of stuff for the open web & internet in general that most people(including folks here) aren't aware of ! SPDY, webkit/v8 engine & even Mozilla are running on their money then there is VP9, webm, webp et al. They might be in the biz of making money but unlike cr@pple/M$ they're not here to kill their competition atleast not with underhanded tactics !
Link to comment
Share on other sites


Google is "sponsoring" Mozilla anyway.

I think it would be beneficial for both and for the endusers if both Firefox and Chrome would support ASM.js, that would become a large userbase so that developers would be more eager to use it too.

If its only FF it would be programming only for one browser, no one wants to make himself more work, so only few Devs would used this new feature.

And as someone said before, FF is also already using SPDY, like Chrome.

One other thing to consider, Google has the money to advertise ASM.js, so more Devs are aware of it...

As long as those features speed up the web, go for it :)

Link to comment
Share on other sites


asm.js is already implement in FireFox 22 nightly , does it mean pages and other stuff will run faster when i use the browser those days?

Link to comment
Share on other sites


  • Administrator

asm.js is already implement in FireFox 22 nightly , does it mean pages and other stuff will run faster when i use the browser those days?

Generally, no, it shouldn't make things faster. As the things probably need to be optimized for this.

Link to comment
Share on other sites


asm.js is already implement in FireFox 22 nightly , does it mean pages and other stuff will run faster when i use the browser those days?

Generally, no, it shouldn't make things faster. As the things probably need to be optimized for this.

ic :(

Link to comment
Share on other sites


What about IE ??? :lol:

Link to comment
Share on other sites


What about IE ??? :lol:

Like always, the odd one out is the ugly duckling ~ in this case IE :rolleyes:

Link to comment
Share on other sites


Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...