Hacker News new | ask | show | jobs
by wwwigham 3314 days ago
So it stringifies the function you give it, splits it into its component bits of execution, then interprets the contents alongside a state machine (with judicious use of bits concatenated together and eval'd). Interesting, for sure. AFAIK there's no preemption mechanism (or resource management), so all it does is make your code execute asynchronously - very asynchronously - the every-line-interwoven-randomly kind of asynchronously.

I do love me some metaprogramming, but is there a real scenario where you'd want something as dangerous as this compared to a generator (or a system of generators)? They have very clear atomicity guarantees (things between yields will happen synchronously), unlike what this ends up decomposing your code into. I suppose that's just the cooperative vs supervised threading debate, though?