Tasklets: a more ergonomic solution to WebWorkers
I&#x27;m not sure how this addresses the resource load of Web Workers.  What about their alternative makes it inherently lighter?<p>I agree that there is an issue here, but this feels like making another thing with bits added.  To genuinely make it lighter weight, would it not need to be a subset of capability.  Otherwise why couldn&#x27;t the efficiency just be added to Workers?<p>The problem seems to be that Workers can only really applied to fairly substantial workloads.   Trivial tasks (x=y+1) can be done on the main JavaScript Thread.  There needs to be something for the middle ground.<p>At a minimum I would have thought that such a solution should enable a parallel form of map, filter, and reduce style operations.  These are operations that are intrinsically designed for non-trivial tasks.<p>I feel that there might need to be a way to distinguish some sort of function purity before such parallelism is allowed, lest JavaScript turn into a soup of races and conflicts.  A way to declare (or ideally automatically identify) functions that do not mutate global state and return a value created from inside the function.<p>Workers handle persistent parallel processing with async communication.  I suspect maintaining that complete persistent state is why the resource load is so high.  The lightweight middle-ground should offer non-persistent parallelism.