Native code extensions - Breaking out of the Corona Sandbox

Corona is too closed. There are many things (understandably) missing from the API, and it's taking a long time (understandably) for Ansca R&D to design, implement, test & document all these things.

My request is: allow users to add native code.
Just a couple of ideas on how this could be done:
- The "iPhone Wax" project has already demonstrated how you could get automatic bindings from ObjC to Lua and back (https://github.com/probablycorey/wax).
- Another option is to add an EDK like AirplaySDK is doing.
- Yet another option is to have a special build mode where Corona compiles to a library instead of an executable, such that we could write our own main in ObjC and call the Corona lib at the appropriate time.

Obviously, this would be something that is more targeting the experienced developers among your customers, but I'm pretty sure there are plenty of those.

IMHO, this should be a very high priority item. Give power to your users, then go back to focus on making sleek & simple cross-platform API's for the most popular requests (as you've been doing in the past).

See also: http://developer.anscamobile.com/forum/2010/05/01/image-manipulation#comment-24640

I couldn't agree more. There is a great community behind Corona and when you give us the possibility to extend its functionality, you can expect massive number of such extensions provided.

I think the iphone wax way would be the way to go.

Although if corona could be built as a library like you suggested that is also a very good idea.

Anyway, + 1

Ive post the very same idea here:

http://developer.anscamobile.com/forum/2011/02/10/original-code-android

I thinks its too close too...

Should be a way to use Corona and make improve the code when Ansca could not supply a solution for something.

I think the only version that I feel would be something useful for Corona would be an EDK. A static library kind puts me in the position of wanting to just roll my own project, and dumping all of objective-c (and relevant frameworks) in via wax would create a really large binary. I shudder at what a blackhole doing that with JNI would be for the poor ansca folks would be.
An EDK would be really nice, and would at least help get stuff like game center in there.

+/- 1

:-P

C

I'm experimenting with a chess software: as you probably know chess engines are usually c programs comunicating with a well known protocol via pipes: is it possible to write a chess gui in corona and embed a chess engine in the final build?
tia

My boss and I have really liked the idea of Corona: Lua programming for iOS and Android. But without access to basic APIs like Game Center, there is no deal. Even if Ansca implement them some day, more features will come in iOS 5 and the wait will go on.

We will probably continue using Unity, which is more complicated, expensive, slow and not proper for 2D. That's life...

Please, guys, consider some integration with Xcode! Even some kind of library compilation in your servers would be great!

+1

I doubt that Corona will be able to keep up with all the native features, and a native interface would give users a chance to keep up.

Wax looks very nice.

-FrankS.

Every time I need something different than the basics, I hit a transparent wall.

1) Threads on these forums stay unanswered for a long time (and that's a general question): Ansca should probably improve his support. This is true for subscribers forums too
2) No way to extend (Ansca is not saying neither yes or no, so I presume the answer is no)
3) The culling issue with Lime maps...
4) Lots of basic features still not there after months

Lua has native support for dynamic linking of external libs. This support is available for Windows, UNIX, LINUX, OSX ( so IOS is also there!), and others.

Please TURN IT ON!!!

Or at LEAST let those of us who know what we are doing build what we need for your inclusion in the SDK.

I have made numerous offers to produce code for you for FREE, if you will just include it in the SDK.

ALL OFFERS HAVE GONE UNANSWERED.

I'm starting to think the success of the SDK is putting all of you in Holiday mode.

You mean

linking

c.

I do like that song!

But, maybe it;s time to get a little more serious.

You appear to be more my age than the typical NCH, I'm sure you understand why I'm getting a little bent, investors and all that junk.

we are aware of the request for external libs. but that would take corona to a new different level and until we have a solid foundation that we can support it as well as all the other issues like the one you mentioned about allowing for your itunes music to be played while running a corona app.... that (music support) in terms of support costs are lower than including lib linkage. without having to deep dive and i will stop here. i think you understand and you would prioritize it the same way.

c

Thank you for engaging.

I don't know your internal state, but I'm sure you are doing your very best with what you have to work with. I agree with most of your decisions and understand the factors and scale you are dealing with. However...

I think it would be in your best interest to provide some way for those of us who have the ability, to extend the SDK. Can you enable 'require' to do dynamic linking of c libs? Perhaps in the nightly builds so we can develop our required functionality.

We don't need support from you on this, just a working interface as described in the Lua 5.1 spec and instructed in 'Programming in Lua 5.1'. I don't think anyone would mind if you flat said "If you use external C libs, you have no support at all from anscamobile". I can accept that.

Just give us the functionality and your test lib source, super secret even, back doorish, I don't care, Please!

Your right, it would take Corona SDK to a new level, it needs to go there soon!

funny thing is that we go back and forth on matters like this, but like i said, i can go on and on about why this is there and that is not there...

and the issue is not just "not support from anscamobile" deeper crevices run at the Apple EULA level. what if there is a lib that allows for interpreted code at runtime? and who runs the risk of having apple shut down entirely? us? that's who apple will shut down. then who is to blame? and because of that, our developers will be SOL.

see how complicated this issue can get really quick.....

thanks for the feedback this will help in our roadmap.

c.

Sorry Carlos, but I do not understand your argument about why Apple would shut down Ansca if one of "us" would take the liberty to misuse any access to linking-in native code.

Any objective-C developer has that option already to link-in any interpreter they want and when they do, Apple will pull their apps and not the IOS SDK company (which would be Apple ;-) ).

Second, other toolkits like Appcelerator, Moai, Wax do support linking-in native libraries and the app developers themselves are responsible for following Apple's guidelines about no interpreted code at runtime. How do Appcelerator and Moai get away with it? Do they have better lawyers? ;-)

As I pointed out before, Ansca is a very small company and it could benefit enormously if you would work together with your users to enhance Corona. Many of us are now at your mercy to implement extended access to platform functionality... which is not a pleasant state to be in as your plate if more than full...

Currently, Corona has an edge over some of the other toolkits, but if Appcelerator provides a bridge to box2d, or if Moai matures enough, you may face some tough competition with your closed approach.

Please, let us help you.

-FrankS.

FrankS Like I said, "thanks for the feedback this will help in our roadmap." Which means, I will, as I have already broach the subject, bring it up again and see what we can do. C.

This thread makes me very sad. I'm currently evaluating frameworks for game development. I really want to use Corona, it seems like a great toolkit. But, while the limitation for native is a big concern (we need to do a custom physics package that has to be written in C), the dismissive tone of the founder here is an even bigger red flag. Why would I want to tie myself to someone who is clearly not interested in listening to his developer community, and basically said, grudgingly, only that he'd "consider it"?

If you are interested in custom code, contact enterprise sales at Enterprise Sales

I made a note of this in our roadmap page.

c.

Ok, I 'get' the augument as to why this cannot be done on iOS but Android doesn't have the same rescritions (does it?). With as many needed features as are still unavailable on Androids, wouldn't this make alot sense? I suspect that functions like OS.execute would be fairly easy to enable for android devices. Maybe I am wrong? Maybe not.

Allen
(Feeling more and more that Corona is only a 90% solution to most problems which makes it 100% useless or worse.... a distraction from the tools that can do the job required)

You cannot please everyone all the time, can you Carlos?

+1 for trying
+100 for giving up and getting things done

cheers,

;)

Allen

I can give you 17 million reasons why Corona is not for you.

http://www.anscamobile.com/#2

C.

Carlos,
I apologize for not making my question clear. I will strive to do better.
My perception of this thread thus far is this:
A request was made to allow users to add native code.
The request was heard (along with various ways of implementing it).
The response was: (paraphrased)
A) “Apple would shut us down if implemented in a way that allows for interpreted code at runtime”
B) “It would take Corona to a whole new level and we want to make sure the backbone is stable before it is extended”

The first question I have is:
On the Android OS, couldn’t this be done without concern about apple?

Even without linking to any external libs directly, the capabilities of the android OS could be greatly extended by allowing certain functions to be used on the device. (I am thinking about functions like OS.execute that have been disabled in order to comply with iOS development standards)

The second question I have is:
What is the likelihood of getting OS.execute(or other functions disabled for the same reason) enabled for the android OS?

I look forward to reading your response,
Allen

Hello Carlos,
Hot topic indeed.

Let's look at Flash with iOS packager. Even on AIR 2.7, the performance still need to be fixed. Here's the weakness compared to corona:
- Performance, to gain better performance, many things must be though beforehand. But it is better now than before
- iOS, must be compiled for >= iOS 4.0
- Android, must target Air for Android
- No support for OpenFeint or IAP or anything that needs native integration

But.., Flash is catching up, and there's advantages on choosing Flash too:
+ Extensive API - bitmap access, sound manipulation, filters, pixelbender (altough cpu), etc
+ Soon will support Stage3D Support for 3D content
+ Soon will support Native Extension according to Lee Brimelow in http://blog.theflashblog.com/?p=2732
+ Extensive Flex UI and controls for non-gaming
+ Many great library from greatest creative minds out there :)
+ IDEs

However, Corona promises features on future roadmap which is a winner too:
+ Shader
+ IAP on Android
+ Maybe... Native code extension? Which enable community to help Corona grows!

For now, we will settle using Corona, with its ease of development. But when Stage3D and Native Extension comes, and Corona can't Innovate enough, we will evaluate our tool of choice.

Just a though from a Corona SDK Subscriber :)

Isn't it beautiful that until now "Flash is catching up"

This is from an 3 billion in revenue company which at one point was the 4th best company to work for, with team of over 150 people on the AIR/Flex/Flash Business Unit that is *finally* about to catch up to a startup of about 15 people whose entire VC funding was what Adobe probably wastes in toilet paper in a day.

We have outmaneuvered Flash and we will continue to out maneuver them.

Molehill is going to be a disaster for them, typical 800 pound mentality, go for the jugular on two sides of the fence, lets put a foot on the 2D and another foot on the 3D.

You mean, they are also planning not just to compete against us but also against Unity3D which is de-facto standard 3D game engine for mobile? Two startups that have outmaneuvered them?

They certainly have the marketing dollars to hire a good mouthpiece and a PR agency, but at the end of the day, it is about performance, and quality and how fast you can adapt. How long since the iOS device been out?

Here is why one of the many thousand reasons they will never catch up, I remember having to go to a meeting at Adobe with 20-30 or so other managers, from engineering to product and marketing managers, who had to deicide the codename for the upcoming product. Wait, don't laugh, the best part, legal had to get into the mix because the didn't want a repeat of the Carl Sagan vs Apple debacle. It took almost two weeks to decide on a code name.

The beautiful thing is that the blog post was written on the 26th of May and I think impetus of the blog was Josh's choosing Corona over Flash.

Certainly reactionary blog response instead of a proactive blog response.

See http://www.wired.com/gadgetlab/2010/04/adobe-flas-jobs/

C.

ps: love poking the gorilla. is it dead yet? no. just old and bitter. smelly too. yeah reeks of ..... phew !

:-) LOL !!!!!!!!!!!

the awesomeness of entrepreneurship and competition. at the end guess who wins? *YOU* !

Isn't it beautiful that until now "Flash is catching up"

This is from an 3 billion in revenue company which at one point was the 4th best company to work for, with team of over 150 people on the AIR/Flex/Flash Business Unit that is *finally* about to catch up to a startup of about 15 people whose entire VC funding was what Adobe probably wastes in toilet paper in a day.

We have outmaneuvered Flash and we will continue to out maneuver them.

Molehill is going to be a disaster for them, typical 800 pound mentality, go for the jugular on two sides of the fence, lets put a foot on the 2D and another foot on the 3D.

You mean, they are also planning not just to compete against us but also against Unity3D which is de-facto standard 3D game engine for mobile? Two startups that have outmaneuvered them?

They certainly have the marketing dollars to hire a good mouthpiece and a PR agency, but at the end of the day, it is about performance, and quality and how fast you can adapt. How long since the iOS device been out?

Here is why one of the many thousand reasons they will never catch up, I remember having to go to a meeting at Adobe with 20-30 or so other managers, from engineering to product and marketing managers, who had to deicide the codename for the upcoming product. Wait, don't laugh, the best part, legal had to get into the mix because the didn't want a repeat of the Carl Sagan vs Apple debacle. It took almost two weeks to decide on a code name.

The other thing is that the blog post was written on the 26th of May and I think impetus of the blog was Josh's choosing Corona over Flash. Josh, who happens to be one of the many Flash converts to Corona going on a daily basis. Certainly reactionary blog response.

See http://www.wired.com/gadgetlab/2010/04/adobe-flash-jobs/

C.

ps: love poking the gorilla. is it dead yet? no. just old and bitter. smelly too. yeah reeks of ..... phew !

:-) LOL !!!!!!!!!!!

the awesomeness of entrepreneurship and competition. at the end guess who wins? *YOU* !

@Carlos:

That's the spirit, Carlos!

You guys have created a wonderful community, and this community creates many wonderful tools/library/suggestion for Corona. Why do you think we are still lurking on Corona's forum and IRC? We do hope Corona will always stay outmaneuvered other 2d game engine tech ;)

This would be absolutely awesome

views:4480 update:2011/9/17 18:17:57
corona forums © 2003-2011