lua-users home
lua-l archive

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

> What unique directions can Lua take which will
> make it better for embedding?

I'm glad questions and comments like yours continue to come up every now and
then.  It means people still care about these issues, and that means that I
continue to have the option of using Lua.  Sometimes I get the feeling that
some people want to take Lua into directions that would make it less
suitable for my embedded work.

And when I use the word embedded, I'm talking about embedded systems-- not
just embedding Lua into a larger application.  And that's a world that I
think a lot of people don't really appreciate.  These kids today with their
gigabytes of system memory, 64-bit processors, and massive operating
systems.  Most of the time the targets I work on are 8-bit and 16-bit
microcontrollers with less than 64k of RAM and ROM, no operating system, and
tiny stacks.  Those platforms aren't really appropriate for Lua as it
currently is, but if you're looking for a unique direction to take Lua,
that's certainly one place I'd like to see future effort.  I keep telling
myself that when I get some free time, I'm going to work on "microLua" a
version of Lua that implements the Lua VM for tiny targets.  At my current
rate, I should have some free time in 2015.

For now, my experience embedding Lua in an embedded system was primarily
with the CPC4400 Ethernet switching platform (see the Lua user products page
for more information for those that care).  I'm also working to embed Lua as
a scripting language inside a home theatre management system that I'm
working on.

But back to my stupid ideas.

I'd like to see the Lua compiler implemented in... Lua.  In my experience so
far embedding Lua into an embedded system, I found that the compiler was
seldom used.  In my case, I precompiled Lua code outside the embedded system
and burned it into flash.  Having the Lua compiler in Lua would let me do
interactive development on the embedded target by downloading the compiler
and then unloading it when I no longer needed it.  I suspect that with
careful coding, the Lua compiler would be smaller (both in Lua source and
object) than the equivalent C code.  I guess this gets into a bootstrap
issue of how would you build the Lua compiler without an existing Lua
compiler.  My brain hurts.