3 ms·
How so? IMHO, it's an elegant demonstration of the async module.
by mattlong 15y ago
How so? IMHO, it's an elegant demonstration of the async module.
- deleted 15y ago[deleted]
- wmf 15y agoCheck out the Cilk version, which is not only concurrent but parallel as well: http://myxman.org/dp/node/182 http://myxman.org/dp/node/182 I agree with jerf that either you shouldn't have to worry about splitting your computation at all or at least you should have syntactic sugar for it. The Node solution has much more noise than code.
- scooty-puff 15y agohttp://hpaste.org/52108 http://hpaste.org/52108
- scooty-puff 15y agohttp://hpaste.org/52109 http://hpaste.org/52109, in case one prefers to be more explicit.
- Detrus 15y agoBut is the async module itself elegant? I guess it's relative, it's even less elegant not to use the module. The async module is still a hack, the cleanest one Node has. I think the whole discussion about "cancer" wouldn't have happened if the V8 team added continuations by now. They mentioned that they will so we might be cleaning up big chunks of code. It's funny how a tech can get so popular with these big warts. Probably because people use it in a very limited way, no one writes CPU intensive code because you rarely need it for serving sites and data. Then the clumsy callbacks aren't so bad.
- justin_vanw 15y agoIt's beautiful how node takes a 2 line algorithm and turns it into 20 lines of twisted magic, lest you block all your connections.