lua-users home
lua-l archive

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


> I understand that it might be desirable for an embedded system on a
> microcontroller with limited RAM to not include the parser and lexer; it
> should be quite straightforward to create a Lua with the appropriate
> characteristics, though ("#define int short" is a good start) and that
> could be used as a cross-compiler (Disclaimer: I haven't actually tried
> this, but I could be persuaded to.)

that idea is exactly what i am looking at doing today, i started a #define
int short, and #define size_t short to match my target, but due to limited
time (was late at night) i didn't manage to get it done, what i did seg
faulted on compiling a lua script, i am pretty sure i know what this is
(liblualib.a) had everything compiled for int's, forgot to remake it.
Perhaps a suggestion, whether it would be worth it or not would for lua
instead of using int where things are going to be dumped use lua_int, and
for sizes use lua_size_t or something like that, there might be more types
that are needed i am not sure. it then means that its far easier to generate
a test platform with the same type sizes and so forth, just change the types
and any necessary size information for that type. Just my 2c worth anyway.

if anyone has sufficient knowledge to implement the above then i am quite
happy to test it, i will probably go through my lua source tree and attempt
to do something as above, i think it is just more the internal structures
and so forth that actually requires int's to be lua_ints and so forth, most
of the api calls and such can stay as ints as far as i can see. if anyone
else is more in the know and either can tell me what exactly has to be
changed then feel free to let me know, i have a weekend coming up as i am
sure most people do so i will probably get most of the stuff done then.

cheers,

    andrew stanley teirney