lua-users home
lua-l archive

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


>> there is one drawback for microcontrollers with a small ROM memory
>> footprint. The scripts are converted into C file and placed in ROM
>> during compilation. If the device has an external storage like SD/MMC
>> card, the advantage of loading and executing scripts is lost(I mean
>> the scripts converted by the tool from loop).

Oh I am not sure what you mean. You want to have luasocket C code linked statically and Lua code loaded onto an external device (~filesystem) ?

Well the loop scripts can just do that. That is the reason why it is separated into two different scripts (precompiler and preloader). If you do not want to embed precompiled Lua code in your application, then just use the preloader for your C files (only gives luasocket.h to preloader.lua)

I recommend you to take some time to read how that works, at the end you'll see that it is not that complex actually! And the best thing is that you need to do 0 modifications to luasocket (or the code that use it)! (And you'll love that when you'll have to merge in a newer version of the lib ;-) )