April 10, 2010

Apple drops nuke on Adobe and developers

The day before yesterday, Daring Fireball's John Gruber was the first to point out that iPhone OS 4 SDK bans cross-compiled applications, promoted as a key-feature for Adobe's upcoming Flash CS5:
"Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited)."
"What they are saying is that they won’t allow applications onto their marketplace solely because of what language was originally used to create them. This is a frightening move that has no rational defense other than wanting tyrannical control over developers and more importantly, wanting to use developers as pawns in their crusade against Adobe. This does not just affect Adobe but also other technologies like Unity3D...
Speaking purely for myself, I would look to make it clear what is going through my mind at the moment. Go screw yourself Apple."
As the dust starts to settle, it does not seem to be clear though, if this was a move by Apple solely to kick Adobe in the sternum. AppleInsider reports today:
"But if Apple were simply trying to block Adobe from cross-compiling Flash to create iPhone apps, it could have added the changed text to its existing license agreement and spoiled Adobe's CS5 party immediately, rather than just threatening change that appears fated to kick in when Apple delivers iPhone 4.0 in June...

The primary reason for the change, say sources familiar with Apple's plans, is to support sophisticated new multitasking APIs in iPhone 4.0. The system will now be evaluating apps as they run in order to implement smart multitasking. It can't do this if apps are running within a runtime or are cross compiled with a foreign structure that doesn't behave identically to a native C/C++/Obj-C app.

'[The operating system] can't swap out resources, it can't pause some threads while allowing others to run, it can't selectively notify, etc. Apple needs full access to a properly-compiled app to do the pull off the tricks they are with this new OS,' wrote one reader under the name Ktappe."
Personally, I am more interested if Unity3D will be affected by this rule as well (as expressed by many other users in the Unity3D-Developers' Forum). In a posting at Unity's official blog, CEO and co-founder David Helgason points out today:
"Here at Unity, we are working hard on getting good information, and working to understand whether – or how – the new changes could affect the developer community and others. We have reached out to both official and unofficial contacts at Apple, we are talking to other companies in a similar situation to us, and we’ve been diligent in reading the ToS to get to the best legal (and business-wise) analysis of it.

We haven’t heard anything from Apple about this affecting us, and we believe that with hundreds of titles (or probably over a thousand by now), including a significant proportion of the best selling ones, we’re adding so much value to the iPhone ecosystem that Apple can’t possibly want to shut that down.

Our current best guess is that we’ll be fine. But it would obviously be irresponsible to guarantee that. What I can guarantee is that we’ll continue to do everything in our power to make this work, and that we will be here to inform you when we know more – as soon as we know more."
It's hard to say how Unity3d might be affected; it produces Xcode and Objective-C source files more like a pre-processor rather than a cross-compiler. But then again, Unity-developers are coding in C-Sharp and Javascript, which seems to violate the point of "only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs." This might be an issue, but could probably be fixed with a Unity-update; Unity3D's team is known for such fixes, as Helgason points out:
"In the ancient days of the App Store (July 2008), Apple changed the kernel to disallow JIT (just-in-time) compilation. We worked around this by changing Mono to AOT (ahead of time) compile scripts instead (this is why some dynamic constructs in our JavaScript doesn’t work on the iPhone). It was a lot of work, but we made it work to enable all these amazing Unity games to be sold in the App Store..."


Apple torpediert Adobe und Entwickler
Vorgestern wurde bekannt, daß Apples neues iPhone OS 4 SDK cross-kompilierte Applikationen ausschließt; eines der langerwarteten Features von Adobes neuester Flash-Version CS5. Daring Fireballs John Gruber berichtete als erster darüber:
"Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited)."
Flash-Guru Lee Brimelow zeigte sich in seinem Blog verärgert:
"What they are saying is that they won’t allow applications onto their marketplace solely because of what language was originally used to create them. This is a frightening move that has no rational defense other than wanting tyrannical control over developers and more importantly, wanting to use developers as pawns in their crusade against Adobe. This does not just affect Adobe but also other technologies like Unity3D...
Speaking purely for myself, I would look to make it clear what is going through my mind at the moment. Go screw yourself Apple."
Während sich die ersten Staubwolken legen, scheint es nicht völlig klar zu sein, ob es wirklich Apples Hauptintention war, Adobe in der verlängerten Rücken zu treten. AppleInsider berichtet:
"But if Apple were simply trying to block Adobe from cross-compiling Flash to create iPhone apps, it could have added the changed text to its existing license agreement and spoiled Adobe's CS5 party immediately, rather than just threatening change that appears fated to kick in when Apple delivers iPhone 4.0 in June...

The primary reason for the change, say sources familiar with Apple's plans, is to support sophisticated new multitasking APIs in iPhone 4.0. The system will now be evaluating apps as they run in order to implement smart multitasking. It can't do this if apps are running within a runtime or are cross compiled with a foreign structure that doesn't behave identically to a native C/C++/Obj-C app.

'[The operating system] can't swap out resources, it can't pause some threads while allowing others to run, it can't selectively notify, etc. Apple needs full access to a properly-compiled app to do the pull off the tricks they are with this new OS,' wrote one reader under the name Ktappe."
Ich bin persönlich eher daran interessiert, ob Unity3D ebenso von dieser Regelung betroffen sein wird (genau wie viele weitere Nutzer im Entwicklerforum). Heute reagierte CEO und Gründer David Helgason in Unitys offiziellem Blog:
"Here at Unity, we are working hard on getting good information, and working to understand whether – or how – the new changes could affect the developer community and others. We have reached out to both official and unofficial contacts at Apple, we are talking to other companies in a similar situation to us, and we’ve been diligent in reading the ToS to get to the best legal (and business-wise) analysis of it.

We haven’t heard anything from Apple about this affecting us, and we believe that with hundreds of titles (or probably over a thousand by now), including a significant proportion of the best selling ones, we’re adding so much value to the iPhone ecosystem that Apple can’t possibly want to shut that down.

Our current best guess is that we’ll be fine. But it would obviously be irresponsible to guarantee that. What I can guarantee is that we’ll continue to do everything in our power to make this work, and that we will be here to inform you when we know more – as soon as we know more."
Es ist schwer abzuschätzen, inwiefern Unity betroffen sein wird. Unity erzeugt Xcode und Objective-C-Quelldateien und verhält sich eher wie ein Prä-Prozessor als ein Cross-Compiler. Andererseits schreiben Unity-Entwickler Code in C-Sharp und Javascript, was eventuell die Bedingung "only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs" betrifft. Dies könnte ein Problem darstellen, allerdings ließe sich das vermutlich in einem weiteren Unity-Update fixen. Das Unity-Team ist durchaus bekannt für solche Workarounds, wie David Helgason klarstellt:
"In the ancient days of the App Store (July 2008), Apple changed the kernel to disallow JIT (just-in-time) compilation. We worked around this by changing Mono to AOT (ahead of time) compile scripts instead (this is why some dynamic constructs in our JavaScript doesn’t work on the iPhone). It was a lot of work, but we made it work to enable all these amazing Unity games to be sold in the App Store..."
:) <- Lutz

2 comments:

Andreas said...

Ich fand diesen Artikel ganz erhellend. Der Autor ist auch nicht glücklich mit der neuen Regelung, sieht aber zumindest eine Menge guter Gründe, die Apple hat. Und eine etwas lakonische Bemerkung fehlt auch nicht:

"If you are constitutionally opposed to developing for a platform where you’re expected to follow the advice of the platform vendor, the iPhone OS is not the platform for you. It never was. It never will be."

Lutz_W said...

Hallo Andreas, ich kann Apples vermutete Gründe sehr gut nachvollziehen: Qualitätskontrolle und die Unterstützung nativer neuer Features wie Multitasking... Ich würde allerdings - nach Actionscript und C# - nicht auch noch Objective-C lernen wollen...

;) <- Lutz