lua-users home
lua-l archive

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


On Sat, Apr 3, 2010 at 12:35 PM, Vafa Khalighi <vafa@users.berlios.de> wrote:
>
>>
>> In what sense? Do you want to use your compiled C function in Lua, or do
>> you want to convert a C procedure into its equivalent in Lua? If the latter,
>> it depends on how complex the code in question is: mathematic operations can
>> be copied and pasted with no changes, but things such as pointer arithmetic
>> will require heavy re-architecting of the code's design.
>>
>
> Thanks. I meant the latter. It seems I have got to rewrite them then.
>

If you don't need cross-platform, then it may be better to write some
wrapper functions and compile your c code into a lua module.

IMO you need to translate c code into lua only if you need to run your
program on different cpu (intel/arm/mips) or different OSs
(win/linux/osx).