Friday, April 9, 2010

Into the firestorm

Yesterday was the day that you didn't want to have anytime soon, if you were in the alternative iPhone app development world.

Apple announced some drastic changes to its SDK, quietly, by publishing a new license on the same day that iPhone OS 4.0 was announced. The twitterverse went bananas after Daring Fireball noticed the change in text.

There are subtle phrases in there that would require a team of lawyers to untangle. What do "originally written", "compile" and "link" mean?

Suppose I write a specification for an app that reads like this:
  • Display background image
  • Display score at bottom left of screen
  • Randomly place 10 bombs on screen
  • When user touches a bomb, remove it and increase score by 10
  • Set 30 second timer. When timer elapses, game is over
I just "wrote" an app in a language called "English". Am I therefore prohibited from making an iPhone version of the game?

What does "compile" mean? Ok, so directly using an interpreter is probably not ok. What if you use a compiler to an intermediate format? For example, let's say you compile C# to C (which then compiles in XCode to ARM). Is that ok because it doesn't directly "compile" against the APIs?

What if the app is written in Objective-C, which is then translated to C#, compiles to Perl, which then is compiled into Lua, which then is cross-compiled into Pascal, which then is compiled to Java bytecode, which is then compiled into C?

How about "link"? Does that mean any language "instruction" that invokes an iPhone API "links" to it? Take the following pseudo-XML:

<circle r=25 x=100 y=50/>

This XML simply tells another piece of code to use native APIs to draw a circle. Does it "link" against the native API? If so, any app that loads XML data could be considered in violation. XML is a "language", and it's not C, Objective-C, or C++. And an XML parser sure looks like an intermediary compatibility layer.

To reiterate, what if I compile most of the app in C first, and the app internally runs a state machine that can do different things based on input? For example, touching the screen paints a circle. Ok, now let's supposed the input isn't from my finger, but is from an XML file that originally was generated by a PHP script on a server?

(Yeah, I know that many XML apps should really be web apps, in general, but XML is commonly used as a format for data exchange on the net, such as retrieving a list of customers from a remote database.)

At what point does a language of any kind become the Application? Is it a 50% binary size kind of thing? What if I have a small piece of code that mostly loads very large images?

What about applications that use SQL? It is a language. Strangely enough, Apple ships sqllite in the iPhone SDK. Does that mean we can't use it?

This is pretty ridiculous. Standard Computer Science says merely that CPUs execute instructions. Those instructions read and modify data. How the instructions are generated, and where the data comes from, are abstract concepts. Apple wants all of the instructions to stay in the Apple box, and they want the data to come from the Apple data pipe as well. That's not good for anyone but Apple.

Developers are like cats. Apple is trying to herd cats here, but has only succeeded in freaking them out.

Interestingly, Windows Phone 7 created the exact same kind of platform lock-in by neglecting to ship a native development kit. That means you can only create apps for that platform in Microsoft's tools. It's a similar situation because things you could do in WinMo 6.5 and before just can't be done in WinPho 7. Unfortunately for MS, they are the also-ran in the smartphone space at this point, so fewer people care. Nonetheless, they managed to royally piss off a lot of developers who have made a large investment in native code on their platforms. Apple's doing the same thing, but in a slightly different direction. MS is saying you can't port to their platform. Apple is saying you can't port away from their platform (at least, not the Objective-C part).

Similarly, Palm originally didn't allow native applications, but more recently shipped a native development kit (which they call a PDK). Maybe Microsoft will relent at some point. They said at one point that they are working with Adobe to port Flash to their browser, so clearly under the hood there's an NDK, just not public yet. Maybe.

By the way, Daring Fireball follows up on the issue makes the strange assertion that "Cross-platform software toolkits have never — ever — produced top-notch native apps for Apple platforms". That is just flat out not true. First of all, most of the entire Adobe Creative Suite is built on cross platform toolkits. Ok, let's stretch reality and say that even though they are popular, they aren't top-notch. There is a laundry list of top iPhone and Mac apps and games that are built with cross-platform tools from Unity.

1 comment:

Brent Noorda said...

Apple is only a couple of iterations from this "no application will be accepted for our platform if the developer has written or will ever write a similar application for any other platform, no matter how those apps are written. IF YOU CREATE FOR APPLE, YOU MUST NOT CREATE FOR ANY OTHER.