lua-users home
lua-l archive

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


imo <imo@mizera.cz> wrote:

> Hi, as the Lua is a virtual machine based, let me kindly ask you
> following:
> 1.would it be possible to allocate the vm “working space”, or some
> parts of it (e.g. tables, functions) to an external ram, accessible
> to Lua via a c-interface, like:
> long ram_rd( long address);
> void ram_wr(long address, long data);
> so we may use _any_ type of an external ram (e.g. serial spi sram,
> fram) for running Lua byte code of almost _any_size_ then?
> 2. is it even feasible to find such points in the Lua source code
> where we can interface such an external ram?? Or it would require an
> rewrite of the entire vm?
> This may enable to run even very large scripts on small ucontrollers
> (e.g. with flash >128kB and ram>16kB) when speed is not a priority.

This will require significant changes to the Lua VM, and I don't think
it will be worth the effort.  You say speed is not a priority, but
running  Lua on a microcontroller _that_ small with so little memory
will be very, very slow.

If you have your heart set on a scripting language for such a
processor, I suggest you look around for a very tiny Forth
implementation.  Various versions of Forth have been implemented on
even 8-bit microcontrollers.

http://www.softsynth.com/pforth/

http://www.mailsend-online.com/blog/flirting-with-forth.html

http://groups.google.com/group/comp.lang.forth/browse_thread/thread/634cd3ab675ee735/5c96d760c0388118?show_docid=5c96d760c0388118

James Graves