lua-users home
lua-l archive

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


[ another repost. --lhf ]

>From: Bennett Todd <bet@rahul.net>
>Date: Fri, 21 Apr 2000 16:57:14 -0400

I haven't gotten back any replies to the request for helpers yet, so
I'm forwarding a Lua question that's come up back to this list, in
hopes someone can donate an answer.

Links manages concurrent I/O with browsing by running everything,
including keyboard handling, from a select loop.

I'm figuring that the sexy way to deposit Lua into the heart of
links will be to put it in charge of handling input from the
keyboard; then there's keyboard input detected in the select loop,
it'll be passed to Lua, which can run it through a keyboard table,
to dispatch to the various functions made available to Lua from the
links implementation. Add the ability to modify that keyboard table,
and to define new functions, and expose enough of links' internals
to lua, and the results should be really hot.

The author of links has taken great care to avoid allowing any
circumstance to cause links to hang. He raised the question, is
there a way for C code to gracefully terminate the execution of a
lua interpreter? The idea is to have his scheduler able to interrupt
lua if someone's extension, in lua, runs for too long. Is there any
graceful way to do this? If not in the current version, will the new
lua with separate contexts make this any more graceful --- e.g. let
the signal handler wake up and simply destroy the currently-running
lua context and initialize a fresh new one?

-Bennett