lua-users home
lua-l archive

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


On Wednesday 24, E. Wing wrote:
> On 6/22/09, Phoenix Sol <phoenix@burninglabs.com> wrote:
> >> But I do have a new question which is relevant to this question. I saw
> >> the announcement of lua-llvm which suggests you can statically compile
> >> down Lua code to native code. Assuming you were just using Lua without
> >> any intent to download and interpret new code, would lua-llvm allow
> >> you to create a completely native, self-contained executable static
> >> binary that would satisfy Apple's conditions?
> >>
> >> Thanks,
> >> Eric
> >
> > It would not be necessary, Eric, as mentioned previously. *You can use
> > Lua in your application.* You just can't download arbitrary scripts from
> > the installed app. I can appreciate where they are coming from there; I
> > just think that 'power users' and 'developers' ought to be able to take
> > that responsibility upon themselves, such as one apparently can on the
> > Android platform.
>
> Apple's app approval process is kind of a mystery and I wouldn't be
> surprised if Apple rejected an app on the basis of them knowing it
> uses interpreted Lua scripts even if there was no downloading of new
> external scripts.
>
> My question is more along the lines of, can lua-llvm be used to
> compile native static binaries such that it is indistinguishable from
> any other app written in C/Obj-C, and you can fairly claim there is no
> interpreted code, thus be in full compliance with Apple's terms and
> get an app on the App store.
>
> Thanks,
> Eric

llvm-lua can be used to static compile Lua script to native code, you can even 
compile them to pure C code using the cbe (C backend) of LLVM.

To use llvm-lua for iphone development would mostlikely require adding 
cross-compiling support to llvm-lua, which shouldn't be too hard since it 
would mostly require Makefile changes.  I don't have a Mac to do 
testing/development on, but I would be willing to help with the needed 
changes.

Also to help with the app approval process you could even remove the Lua 
core's interpreter & parser to only allow native compiled functions to run, 
this might also lower Lua's code footprint a little bit.

llvm-lua could also improve the performance of the compiled scripts too.

-- 
Robert G. Jakabosky