lua-users home
lua-l archive

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


Hi,

I am considering using Lua as an embedded scripting engine for a mobile
phone game. The game backend will be coded in C, with Lua providing the
ability to download games and other content as requested by the user.

I wanted to ask if anyone is aware of any things in Lua that may cause
problems or issues when running on a mobile phone. The issues I am aware
of at the moment are:

	- Memory allocation. I think it should be simple to provide my
own custom allocator, so the Lua memory allocation / deallocation
conforms to the rest of the project. I have made similar modifications
to Zlib in the past.

	- C standard library. Some mobile phone platforms don't provide
a complete C standard library. It is common for file IO and debug
printing to use API functions rather than C standard library functions.
Again this shouldn't be too hard to resolve with some Macro's and
platform specific compilation.

	- Only floating point emulation. This might be the biggest
issue, since Lua uses doubles which will be really slow. The C engine
uses fixed point math exclusively. I guess it is possible to replace all
double usage with equivalent fixed point operations.

Any pointers, advice or "gotcha's" would be appreciated.

- Daniel Collins