tags:

views:

364

answers:

4

Is it possible to run Lua interpreter on the iphone? If yes, are there any libraries that have bindings to Iphone's SDK? If its not possible with Lua, what are the other language options?

+5  A: 

Yes, many applications on the store (specifically games) have used Lua. However, be advised, with section 3.3.1 of the new developers agreement, calling into iPhone SDK routines from a language other than C/C++ or Objective-C/Objective-C++ is explicitly forbidden (included also is JavaScript but only on the WebKit engine, not outside of it). Therefore, if you're getting the idea you'll write your application in lua, be aware that even if it makes it through review, which is unlikely, it could be pulled at any point if you're using it for calling iPhone SDK routines.

jer
If that's the exact word of the agreement, then you have to make wrappers around anything you want accessible in lua, then register those wrapped functions. :P
RCIX
Obviously it's not the exact wording, however, it is the important bits as have been interpreted by many more knowledgeable folk than myself. However, I have asked Apple a question similar to this (before 3.3.1, specifically though as it pertained to interpreters) was that so long as I wasn't allowing users to make changes to the app, and it performed in a known way, it was fine. So I assume the same just extended to the fact you can't call SDK APIs from your lua code.
jer
+4  A: 

See the Ansca Corona SDK.

lhf
How does this SDK get around the new developers agreement referred to by @jer?
Judge Maygarden
Noone knows whether it does or doesn't. The agreement is for the next version I think. There are other converters: MonoTouch for C#, Adobe's Flash compiler, and Unity 3D. Whether all of these will be rejected is unknown. (Actually, it is for sure that Flash is blocked as you might already know :) )
ustun
See the blog for further info http://blog.anscamobile.com/2010/04/corona-and-iphone-os-4-0/ look at other posts too.
ustun
@ustun, actually, the agreement takes affect the moment you agree to it. Which means, it's been in effect for a while now.
jer
+2  A: 

In addition to the Corona SDK mentioned above, see also iPhone Wax.

Alexander Gladysh
+2  A: 

Apple has recently revised their TOS to explicitly allow for Lua engines such as the one in Ansca Corona. So there is no need for worry about that.

Absinthe