Re:Compiling to Lua
by cmwelsh on Friday August 23, 2013 @09:05PM
(#6267126)
It seems like a step backward. Dealing with callbacks manually is an unnecessary hassle compared to being able to use "green threads". See python gevent and ngx_lua for examples of people doing things this way.
[ Parent
| on HN ]
Check out Luv - an attempt to use Lua's coroutines to do green threads/fibers, integrated with libuv.
luv does a fantastic job of sticking with Lua coroutines. The master branch still has zeromq in it, but the latest work is done in the ray branch. Sadly, it doesn't seem the project is moving, so most of the libuv features are not yet implemented the "ray" way.
Edit: Seems ray does have most of libuv features, sorry.
Yeah I never really understood luvit. Callbacks make sense in JavaScript because it doesn't have coroutines. But Lua has coroutines! So why does luvit use callbacks? It does seem like a step backward.
Historical reasons. The guy who wrote luvit knew NodeJS but didnt know Lua when he started working on it.
Re:Compiling to Lua
by anonymoushn on Friday August 23, 2013 @10:56PM
(#6267399)
and node-fibers :o