views:

154

answers:

4

I've got an iphone app and I'm looking to port some of the data-layer objective-c code to a scripting language which can also run on an android phone.

Any suggestions on what to use? I'd also like to be able to push new scripts to the app for bug fixes. Not sure if this is against the iphone SDK agreement or not.

+1  A: 

As far as I know, iPhone SDK agreement forbids using any scripting languages in your apps.

On the other hand, JavaScript runs both on Android and iPhone (and a couple of other platforms) and is a very powerful language.

Radomir Dopieralski
+4  A: 

JavaScript. Anything else is explicitly banned by the Apple Store Vetting process.

(You could actually serialize some Objective C objects and take advantage of some of the dynamism in the language, but that won't get you far with Android. So, JavaScript.)

Weston C
Lua is also allowed, so long as the scripts are embedded, not downloaded. I suspect this was done to keep the game industry from walking away from the platform entirely. http://touchreviews.net/apple-lua-iphone-developer-agreement/
John Franklin
Interesting -- I hadn't heard about that. Looks like you still need to get approval from Apple in writing for that particular use, though -- not that you don't already have to hop through hoops to be in the App store, so maybe it's not that big a deal.
Weston C
+1  A: 

The only scripting language that Apple allows for use with downloaded scripts is Javascript.

You can execute the Javascript code inside a visible or invisible UIWebView.

hotpaw2
A: 

If you write a domain specific language in XML and parse it that way, you could do what you want.

Both platforms can easily parse XML.

Kendall Helmstetter Gelner