

Intel "River Trail" (Parallel Extensions for JavaScript) - pavlov
https://github.com/rivertrail

======
pavlov
River Trail is an interesting new project by Intel that brings GPGPU-style
parallel execution concepts to the web.

This is not a generic parallel execution API; there are no threads or locks.
From the developer's point of view, River Trail's whole API is contained in a
class called ParallelArray:

[https://github.com/RiverTrail/RiverTrail/blob/master/jslib/P...](https://github.com/RiverTrail/RiverTrail/blob/master/jslib/ParallelArray.js)

Once your data is in a ParallelArray, you can pass JavaScript functions to be
executed on the ParallelArray's elements using the following constructs:

* map * combine * reduce * scan * scatter * partition * filter

Behind the scenes, River Trail takes your JavaScript function and compiles it
into an OpenCL kernel. (It appears to use Brendan Eich's 'Narcissus', a
JavaScript compiler written in JavaScript, as the front-end for this
compiler.)

It seems pretty clever and well thought-out. The API is pleasingly small, and
very "JS-native" because you don't need to learn a different programming
language to express kernels. I'm hoping to see River Trail in browsers one
day.

