Adding External Functions

While I am new to iOS and Android development, I am very experienced with Lua. And in the kinds of applications I wish to write, I will need to add features to Lua. One small example is bit manipulation. Yes, in the (near) future, Lua will incorporate this natively, but I don’t know when that will be released, and I don’t know when Corona will start using the new Lua, if ever.

In my current work with Lua, whenever I need to do something I can’t natively, I’ll write a C or C++ extension and either statically or dynamically link it in. Sometimes this is to do something Lua can’t. Other times, it’s to reuse existing code and put a Lua wrapper around it. But regardless of the reason, it’s necessary for the applications I write.

So, now that we’ve moved beyond beta and Corona is now a real product, I’ll ask again: Can I do this? I’m not asking for support. I’m not asking for private Ansca API’s to be exposed. I’m not even asking for the ability to extend the simulator (although gosh, that would be nice). All I need for me to write applications (and for Ansca to get a $250 yearly subscription from me) is the ability to statically or dynamically link lower level code from C.

Alternatively, if it isn’t possible, is there some workaround? For example, could I develop a front-end UI and high-level logic in Corona, but have the lower-level networking and other processing implemented as a separate application that runs concurrently? The two could talk over a local socket.

Please people, help me here. I want to develop iOS applications (and eventually Android too), but I don’t want to bother with Objective C. I know Lua, I love Lua, and I want to use Lua. But if Corona is going to restrict me to just the functions listed in the Reference, then Corona is nearly useless to me.

Thanks. [import]uid: 188 topic_id: 2089 reply_id: 302089[/import]

We Love Lua ! That’s why we chose it to begin with. We live, breathe and dream in Lua coding too !!!

Just a few entries from your post there is this forum entry:

http://developer.anscamobile.com/forum/2010/09/12/native-api-access-and-custom-module-support

The question being of course, can we expose a way to allow you to implement your own native code to Corona, dynamically, statically or other unknown way… :wink:

The short answer is that we are aware of this request and we are figuring out how/what/when/why of the feature. We just shipped Corona and it is time for the team to get all the requests and start going through them and see which one are the MVF’s and go from there.
Carlos [import]uid: 24 topic_id: 2089 reply_id: 6227[/import]

I’d say this is the most important feature request of all, because it can subsume the requests about GameKit, In-app-purchase, MapKit, iAds, etc.

Once this is available the community can start working on adding those features. [import]uid: 7026 topic_id: 2089 reply_id: 6340[/import]

… [import]uid: 5712 topic_id: 2089 reply_id: 6343[/import]

As you figure out the how/what/when/why of adding this feature, please keep the following in mind:

  1. There are developers-- like myself-- who are simply locked out of doing entire classes of applications without this feature.

  2. There are developers-- like myself-- who would gladly give Ansca $249/year and sing the praises of using Corona for developing iOS/Android applications, but that’s not going to happen until we can add the external functions we need.

  3. Lua natively offers a nice and simple model for adding external functions. You don’t have to do anything more than provide some means to hook to what Lua already provides.

  4. As was mentioned, once this is added, you can rely on the community to extend Corona for you.

  5. The majority of users who want this feature are more advanced and can deal with weirdness. If this feature is delivered but has limitations (bizarre incantations needed to make it work, doesn’t work in the simulator, only works with C/C++/Objective-C, can’t directly access Corona libraries, etc.) then we’ll grumble, but at least we can move forward.

[import]uid: 188 topic_id: 2089 reply_id: 6350[/import]

+1

Objective-C, Unity3d and Cocos2d (the 3 big iDev platforms) already provide this functionality.
80% of things must be made with extreme easiness but the left bizarre 20% must be doable too!

Development freedom, as a matter of fact or just as an illusion, is an essential selling point :slight_smile: [import]uid: 7356 topic_id: 2089 reply_id: 6351[/import]

I am waiting for this… been using cocos2d and xcode while corona is “locked”. As soon as there is a clear roadmap to integrate objective-c exposed into the lua API I will start using corona. Two year paid subscription and eagerly waiting.

PLS

[import]uid: 5899 topic_id: 2089 reply_id: 9396[/import]

I agree. If I had to choose any one feature to add to Corona, it would be this one.

With this, I can do ANYTHING else that I need to from in-app purchase to gamekit to anything available on the device.

I know that I ansca is really pushing Corona as a cross-platform tool and this goes against that a bit, but I’ll say right now that I would prefer to write 2 completely separate apps than to not be able to access the full platform available to me. [import]uid: 4899 topic_id: 2089 reply_id: 9405[/import]

Any hints on wether this will be one the the Most Valued Features? [import]uid: 10454 topic_id: 2089 reply_id: 9490[/import]

Exactly my thoughts.

I would rather write two versions for two different platforms if that gives me complete control (what apple intends or calls Complete) on the platform, access to the native UI, functions and functionality.

The cross compilation can be used in conditional compiling or via separate applications all together.

cheers,

Jayant C Varma [import]uid: 3826 topic_id: 2089 reply_id: 9536[/import]