lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Jun 1, 2009 at 2:35 PM, Linker <linker.m.lin@gmail.com> wrote:
> Hi,
>   Event-driven is no a good choice for lua programming.Coroutine is a better
> choice.

AFAICT, there's nothing in Lua that hinders event-driven programming.
in fact, when i write a coroutine-based multitasking-like scheduler
(i've done it several times already), i start with an event-driven
central waiting call to drive it all.

also, having first-class closures is a godsend to do callback-style
APIs, just like any interactive javascript library does.  so, i'd say
that event-driven is quite natural in Lua. if you like to put
coroutines on top of that, it's a nice extra, but certainly neither
mandatory nor exclusive.

-- 
Javier