3 ms·
One solution that will almost certainly get implemented is WebWorkers. From that you get string-only message passing (though it'd obviously be easy to do json-
by rictic 17y ago
One solution that will almost certainly get implemented is WebWorkers. From that you get string-only message passing (though it'd obviously be easy to do json-encoding of data in messages) between js processes.
That, combined with event based non-blocking apis for managing multiple tasks neatly covers more or less everything you can do in many other mainstream languages like Python and Ruby (excluding some magic in native code extensions).
- jerf 17y agoThat makes some sense. I would agree that it should be optimized to specify that JSON-able objects should be passable in such a way that it is if they are being fully serialized out to strings then deserialized again, giving the implementation the ability to do some optimization (which may or may not be a good idea but you'd have to try it to find out, best not to write yourself into a corner), but actually doing that in a library would be easy enough. Given the way that JS performance has been moving, that would indeed be able to take on quite a workload, if you can run a decent number of "webworkers" at a time.