Quote Originally Posted by ozmic66 View Post
@flashkit

On a slightly different note:
Checking out the haxe iphone thing, it seems like we may not need either language! But I'm not sure how this will practically work out... (plus I always prefer to code natively) Does anyone have a deeper insight into the topic?
Hi,
To use haxe and the iPhone, you will need to learn haxe, and have a few ideas about putting an xcode project together.
Haxe is very similar to as3 - certainly much closer than either c++ or ObjectiveC. Have a look at gm2d.com for a taste of what a haxe game code might look like. The idea is that you write in haxe (using essentially the flash API) and then compile the code to swf or iPhone (or mac, windows or linux). ie, One code base for all systems.
Compiling the haxe code gives you an iphoneos library that you link against the provided stub libraries to produce an executable.

If you are looking to make your own system, you can make it for c/c++ or ObjectiveC. You will need to write some ObjectiveC to interface to the iPhone, but users of your library will not - they can just link against your library however you want them to.

A big difference between as3/haxe and c++/ObjectiveC is memory management. as3 & haxe use garbage collection, while the others (can) use reference counting. Reference counting can be a bit tricky (and slow) - especially where event handlers are concerned, since it is easy to create circular references. I guess you will need some kind of "weak reference" system. Alternatively you could use a garbage collecting library. I tried Boehm GC, but that seemed a little slow in the iPhone (very good on other systems, so maybe it is just not optimised), so I ended up rolling my own. Or else you could push the compexity of memory management back onto the users of your library. This would end up with the fastest code, but it would make porting as3 code harder.

There are currently 2 main problems with the haxe for iphone. 1. It is not complete yet, and 2. It uses SDL, which is LGPL license, and since you can't dynamically link on the iPhone this means that technically you need to provide your haxe-created library file (not the source code) so that others may re-link it if they so desire.
I am working towards finishing point 1, and eventually, I will replace SDL with something that has a nicer license for real developers (although, as it stands, it is not too bad, since the library is very similar to the exe in many ways).

Chookmaster (aka Huge).