You are not logged in.
Hi,
i've experimented with Google's v8 engine and the result is a little extensible scripting environment that offers a simple interface for running code in parallel.
In detail there is a 'concurrent' namespace that allows you to spawn a JavaScript function in a new process. Processes can send messages to each other.
Messages are just normal JavaScript data like arrays, strings, functions...
It does not run in the browser. It's executed, like shellscripts (#!). There are also some modules for basic stuff (like filesystem, shell...) and a repl but don't expect much
It does also implement (a part of) CommonJS, so there is a 'require' based module system that allows you to load JavaScript or C++ Modules. Oh and it comes with the
CoffeeScript compiler, so you can do all this things in CoffeeScript if you like.
I know there is Node.js and I don't have any plans to make a similar product. This is really just a little experimental project that i made to learn and because it was fun to program.
Note that it comes with precompiled binaries of v8 and protobuf (a serialization lib by Google) for i686 and x86_64. Not sure if this is the best way...
If you wan't to take a look at it or if you are working with v8 yourself, here it is:
https://bitbucket.org/pb82/asteria/overview
(The code base is quite small, some examples of how to use it are provided, but unfortunately there is no documentation yet)
Any feedback / critique welcome.
Offline
I'd rather use a continuation based approach in pure JS, and an API similar to that of Racket's threading (allows for channels and messages using a concept called mailboxes).
In Zen they say: If something is boring after two minutes, try it for four. If still boring, try it for eight, sixteen, thirty-two, and so on. Eventually one discovers that it's not boring at all but very interesting.
~ John Cage
Offline
Yes that would probably be a better fit to a language like JavaScript. The idea to build a message-passing system came to me while reading the Erlang chapter of 'Seven languages in seven weeks'.
Interesting that you mention Racket. I've played with it and i really liked it. But i never got so far as to use threads. But i would really like to use Racket more.
Offline