Parallel JavaScript will turbo-charge web apps, Intel says  

Posted by Daniela Mehler

Intel released an open source engine for JavaScript that will let the language tap into multi-core CPUs and their vector extensions. Code-named "River Trail," the Parallel Extensions for JavaScript will extend browser-based apps into new areas, such as photo and video editing, physics simulation, and 3-D gaming, according to the company.

Web applications using HTML and JavaScript are now being touted as a compelling alternative to native apps by everyone from Apple to Microsoft (especially now that the Windows 8 Developer Preview has been released). But, according to Intel, web apps don't do a good job of supporting multiple cores, even with the aid of WebGL .

In a Sept. 15 blog entry , Intel Research Scientist Stephen Herhut writes, "JavaScript, the language behind the web, does not give applications access to multiple cores, let alone vector instructions. Thus forcing me to use native applications where performance matters although I would prefer staying in the browser. Clearly, it is time for JavaScript to catch up."

To facilitate this, Intel used this week's Intel Developer Forum in San Francisco to unveil Parallel Extensions for JavaScript, code-named "River Trail." This open source project -- first manifested in the form of a Firefox plug-in -- will eventually make browser-based apps capable of photo and video editing, physics simulation, and even 3-D gaming, the chip giant says.

Parallel JavaScript will turbo-charge web apps, Intel says


An HTML5-based physics simulation being speeded up by River Trail
Source: Intel
(Click to enlarge)

According to Intel, River Trail extends JavaScript with parallel constructs that are translated at runtime into a low-level hardware abstraction layer. As a result, the language can now leverage multiple CPU cores and vector instructions, the company explains.

Herhut adds, "Much effort was spent to make this extension feel as natural as possible. Our goal was to make writing web applications with River Trail as easy as writing regular JavaScript."

Furthermore, River Trail combines well with other upcoming HTML5 APIs, Intel claims. "We in particular made sure that River Trail plays nicely with WebGL, the recently introduced JavaScript API to OpenGL used for 3D visualization in the browser," Herhut writes.


A demonstration of Parallel Extensions for JavaScript
Source: Intel
(click to play)

Intel didn't quantify the potential speed improvement, but released the above WebGL-based demo. According to the company, this shows a physics simulation with 4,000 bodies, which runs at just three frames per second with traditional sequential JavaScript, and at more than 45 frames per second with River Trail.

In his blog posting, Herhut concedes that some are concerned about the security of remotely loaded JavaScript code. (For its part, the Microsoft Security Response Center attacked WebGL last June , saying it is "not a technology … [we] … can endorse from a security perspective.)

"Protecting the user from abuse and ensuring the security of River Trail therefore were major concerns in the design," Herhut writes. "River Trail was designed to inherit the security traits of JavaScript and I am confident to say that our extensions to JavaScript do not add any further attack surface to the browser."


Intel's Stephen Herhut discusses River Trail
Source: Intel
(click to play)

In a related development, Intel released Service Pack 1 for its Parallel Studio XE 2011, a tool suite designed to help C, C++ and Fortran developers implement parallelism in their applications. The new version adds support for Cilk Plus v1.1, IEEE 754-2008 , and Intel Threading Building Blocks v4.0, the company says.

Further information

Further information on Intel's open source Parallel Extensions for JavaScript, as well as a Firefox add-on, is available on the GitHub website .

Jonathan Angel can be reached at jonathan.angel@ziffdavisenterprise.com and followed at www.twitter.com/gadgetsense .

This entry was posted on 3:17 PM .