River Trail - Intel's parallel JavaScript
River Trail - Intel's parallel JavaScript
Written by Harry Fairhead   
Friday, 16 September 2011

While Google is thinking of replacing JavaScript with Dart and Microsoft is working on accepting it as a first-class language, Intel is hard at work making JavaScript work harder.

River Trail is an open source parallel JavaScript engine.

Why Intel?

Well they have a lot of multicore processors and River Trail makes use of them. It extends JavaScript with a few simple data-parallel instructions but the result is still recognizably JavaScript. It works with HTML5, Canvas and WebGL, in particular. It makes use of OpenCL as an intermediate language so it could work on any hardware not just Intel's. Brendan Eich, the inventor of JavaScript, was present at the presentation of River Trail at the Intel Developer Forum and commented that he would lobby for it to be part of the ECMAScript standard.

The approach to parallel programming is fairly standard via parallel data structures. A single new ParallelArray object provides all of the new behaviour needed. You can convert a standard array, including a Canvas pixel array, into a ParallelArray or create a new object using raw data. Once you have a ParallelArray you can operated on it using new parallel methods such as map, reduce, combine, filter etc. All synchronization and locking is taken care of automatically.

WebGL brings 3D to the browser, but without parallel processing even the fastest serial JavaScript engine isn't going to be capable of producing great graphics. With parallel implementation everything and anything is possible. The demo app in the video below shows a physics simulation with 4000 bodies using WebGL and the difference between serial and an eight-core implementation is all-important. The serial version crawls along at 3fps but the parallel version looks like an animation at 45fps.

 

                  

You can see River Trail in action in an application that is closer to a 3D game in the following video, but the sound quality is poor.

 

 

If you are inspired, you can download a browser plugin for Firefox and start writing parallel JavaScript today.

More information

River Trail download

 

rivertrail

 

To be informed about new articles on I Programmer, subscribe to the RSS feed, follow us on Twitter or Facebook or sign up for our weekly newsletter.

Banner


//No Comment - Is Parallel Programming Hard; Column Subset Selection Is NP-complete & The Balance Attack Against Proof-Of-Work Blockchains
16/01/2017

Is Parallel Programming Hard, And, If So, What Can You Do About It?  

Column Subset Selection Is NP-complete

The Balance Attack Against Proof-Of-Work Blockchains: The R3 Testbed as an Exam [ ... ]



Top 10 From Around The Web: JavaScript Web Development Resources
13/01/2017

The I-Programmer team originates a lot of stuff and reports a lot of news, but there's far more out there than we can possibly cover. So from time to time we trawl through other people's blogs to find [ ... ]


More News

Last Updated ( Saturday, 17 September 2011 )
 
 

   
RSS feed of news items only
I Programmer News
Copyright © 2017 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.
Banner