Apple Splits Hairs - Compilers vs App Builders

Do you speak binary?

01001001 00100000 01100010 01100101 01110100 00100000 01101110 01101111

(Translation: I bet no) Try yourself. Well this is what all CPUs “speak” as you likely know.

For those of not binary native speakers we generally rely on higher level languages like C/C++, Java, Ruby, PHP, JavaScript and so on to communicate with computers and instruct them to what we want done.  Our hopefully correct thinking expressed in a higher level language is translated into something that eventually makes it to binary.  I know I know you might talk about assembly, but you get the drift for what we need to understand here.

Now we can discuss how the translation happens, ahead of time (aka Compilation) and execution time (aka Interpretation) or some hybrid worst/best of both worlds (aka Just In Time Compilation or JITing) but that also is somewhat irrelevant to today’s post.  Just understand we transform one representation of an idea, er program, into another so the computer can run it.

I think we all know this process if we’ve ever coded something even fairly trivial.  Now recently Apple has decided that it is going to ban this process , or at least the kind they don’t like.  You see Apple isn’t keen on Flash  and much ado has been made about them not supporting it on their ever popular iPhone and iPad, something about CPU drain, etc.  Probably more about app store control, but whatever.  However, the war escalates  so now they have decided that it is not legal to use some software that will transform Flash into an allowed native application

Seriously!?  As a semi-serious computer scientist this is UTTERLY LAUGHABLE.  The hair splitting of this legalese is bound to become a classic.

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).

Ok so we can only write in their four prescribed languages, all other languages are illegal? What’s next no Spanish speaking apps? (sarc)

It is especially key the word “originally.” You see otherwise it goes like this, I write in Flash in other words ActionScript and then press a button and it makes C in an intermediate form and then press another button and it makes the native API calls in one of the four approved languages. However, the “originally” of course keeps me from doing that. They need to know what my inspiration is.

I am wondering if I write pseudo-code on a piece of paper that is in Lisp and then use my brain and translate that into C if that is illegal? I guess not if my brain doesn’t qualify as an “intermediary translation or compatibility layer or tool”!

I especially like “…directly link against the documented APIs.”  It is interesting the choice of the word link here and directly, they avoid the words invoke or call.  This is interesting because I wonder if there was some API called doMagic() and I happened to write my own doMagic() method (spelled exactly the same) which in my illegal language which  will eventually call their doMagic() after some process then that is disallowed.  They are trying to with the use of the mention of compile and link as well as the insertion of “compatability layer” knock this down.

It is interesting the use of the word compile too.  How about if write an interpreter for the iPhone OS?  Is it ok then to call things or do I have just compile?  Can I write a VisualBasic interpreter and sell it in the AppStore?  Then can its programs call things, you see they aren’t compiled they are interpreted?  Well likely they won’t allow that app to come into the app store, so that won’t work.

Finally in an expected, but legally bizarre turn, is the inclusion of JavaScript. You see the allowed language (JavaScript which BTW is generally not compiled per se) and ActionScript (the disallowed language) are literally kissing cousins programming language wise. They both have ECMAScript cores and if you use ActionScript 2 the major difference is the object model more than anything else. AS3 of course introduces a bunch of stuff that was supposed to be in JS2 but of course that never happened so forget that, it’s clearly a COMPLETELY different language.  The allowance of JavaScript as an approved language is a loophole itself since honestly the precise definition of what constitutes that language is actually somewhat debatable since the environmental objects e.g. DOM, browser objects, are not really part of it given the sad state of specs. Likely one could argue that ActionScript (at least AS2 somewhat) is a form of JavaScript given the ECMAScript angle. There would be plenty of a historical documentation about Adobe’s participation in the JavaScript environment with tech donations and what not to make a strong case that ActionScript counts as a JavaScript language.  If not you get into Clinton-esque definition arguments about the word “it” when you try to pin someone down on exactly what the word JavaScript covers?  Clearly if you want to be silly Microsoft developers can’t build iPhone apps they use JScript as “it” is not JavaScript right?

But of course Apple can do what it likes right? You wanna build an app, this is a contract and you agree to play in their sandbox so their rules!  Really, contracts can say what you want that doesn’t make them legal or enforceable every single time. But folks what do I know I only teach programming language theory, write books on JavaScript, know about Flash, etc.  This is just an opinion equal to any other person with a blog so dismiss away, but regardless my conclusion is…time to lawyer up folks this should get messy.


p.s. Oh and if you were wondering, yes I have been an expert witness on JavaScript related cases.

p.p.s. I own both an iPad and iPhone and like them quite a bit, but this doesn’t make this technology fight or legal language any better. I am not arguing for some “break the Apple walls down and go free for all”, but simply be reasonable about things. The what not the how should be concern of a program allowed on the device.

Related Articles

Your Tags are Slowing You Down

Tags are an important way to track analytics on your site, but they may be increasing your load time. ...

Jun 28th / By Nate Weintraub

The Benefits of Installing SSL

Installing an SSL Certificate on your website provides a myriad of benefits including keeping modern browsers from telling your users your site is insecure. ...

Jun 22nd / By Julian Dutton

Tell us about your project

Please fill out your information and submit