5 ms·
OK this is really interesting because one of the obvious criticisms you can lob over at Node.js is that the nested callback program structure that Javascript fo
by po 15y ago
OK this is really interesting because one of the obvious criticisms you can lob over at Node.js is that the nested callback program structure that Javascript forces onto you is somewhat ugly and hard for a developer coming from more traditional frameworks to reason about.
Being able to use Lua's coroutines makes this quite interesting.
https://github.com/luvit/luvit/blob/master/examples/fs-coroutines.lua https://github.com/luvit/luvit/blob/master/examples/fs-corou...
- olegp 15y agoCoroutines are available in Node via the fibers package (https://github.com/laverdet/node-fibers https://github.com/laverdet/node-fibers). For benchmarks comparing performance to purely asynchronous webapps, check out the README to my Common Node project (https://github.com/olegp/common-node https://github.com/olegp/common-node), which implements a number of synchronous CommonJS proposals on Node using fibers.
- diamondhead 15y agoMy opinion about the common thought saying "NodeJS forces you to code many callbacks that seem ugly" is that some people hesitate to abstract that functions.