lua-users home
lua-l archive

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

On Mon, Jan 12, 2015 at 8:26 PM, John Hind <> wrote:

> @Bogdan Marinescu - _javascript_ was originally (and still is of course)
> a browser embedded language designed from the start to be event-driven
> (if indeed it was ever consciously designed!).

Lua is an *embeddable* language designed from the start to be used embedded
in other applications (that is, all actions start in the host). To me, this
sounds remarcably similar to event-driven.

-- Roberto

[John Hind] You are right of course - when Lua is used as an embedded
language in games it is generally event-driven analogous to _javascript_ in a
browser. My point was about the design of runtime environments for Lua not
the language itself. My view is that when a scripting language is put on a
microcontroller it should be implemented within an event-driven framework
(were the events are essentially the hardware interrupts).  The tendency has
been to implement a simple command line environment based on lua.exe with
libraries to access the hardware essentially forcing the programmer to write
a non-terminating polling loop in Lua. It sounds like Bogdan is already
thinking along these lines.

Bogdan is already thinking along those lines, yes :) When I get some time, I'll definitely play a bit with event loops and Lua on bare metal. Maybe something built around a stripped down version of libuv, or even something simpler than that. Goodbye, weird and yet heroic attempts of implementing interrupt handlers directly in Lua, and hello sleep modes and low power! When I get some time ...