Originally Written?

I wonder why Apple included the word “originally” in “Applications must be originally written in Objective-C, C, C++, or JavaScript”?

If you are building a platform of unhackable devices then you need to control the gateways to hacking; i.e. the tool chain and the application distribution channel.  So the clause above’s purpose is to due just that; e.g. if you want to hack code to run here you gotta pass thru our  interpreters, our compilers.    But they wrote something stronger.  They wrote is that you have to write in language A,B, C, or D.  Only.    Your not allowed to write in language X, Y, or Z – even if you cross compile X, Y, or Z into A, B, C, or D before you deliver.  I don’t get it

For clarity: this means you may not write a program in say Python, and then run that program’s source text thru a Python to C translator before compiling it before submitting for Apple’s approval.

One of the things that lead me to Lisp was noticing how most of the programs I wrote weren’t in the language the compilers offered me, but instead we would design a custom language better suited to the task at had.  For example the rule system that drive a compiler’s optimizations, get some delicate thing to work on multiple systems, or the custom notations that generate the object system.  Once I accepted how central that is to software architecture, I wanted a language that respected and encourage that.

I’m not terribly surprised that Apple has decided to run the audacious experiment of creating a platform that strives for devices are no longer computers once in the hands of the end user.  Devices which the end users can not hack upon.  I think it’s kind of vile and it worries me that they may succeed, but it doesn’t surprise me.  I should write another post about how potent such a platform will be if they can sustain it.

They aren’t the first to go down this path.  It’s what the locked phones do.  This is what some of the game consoles do.  And I guess if you fully embrace my presumption that the right metaphor for modern websites (aka applications) is that they are massively multi-player games, then it’s only  inevitable  that game  industries  habits would move in the rest of the application stack.

By way of amusement this clause would appear not prevent you from doing a less interesting but still common architectural trick.  I.e. where you write in a dialect of language A, call it A’; and then cross compile from that into A before running thru their tool chain.  So if you can cast your need for a domain specific language into a dialect then you can sort of wiggle around the restriction.  To my surprise there is an important example of this, Caja.  Caja is a dialect of Javascript with some extremely desirable security features.  It’s used by Yahoo and Orkut (for example) to assure that third party widgets are tightly constrained in the damage or snooping they can do to other portions of the web page.

And I guess there is always C++; you can do some very wonky things at compile time in C++.

3 thoughts on “Originally Written?

  1. Luis

    Pure platform lockin play. They want to prevent writing cross-platform phone apps that would help allow users to migrate freely between iphone/android/etc. No other reasonable explanation.

  2. David Coletta

    When you stare into the abyss, the abyss also stares into you. I had always assumed that the phone companies would be more transformed by Apple than the reverse, but it’s clear now that Apple is also being transformed. (Though maybe this is what they always would have wanted to do and only now have the power to do.)

  3. bhyde Post author

    Luis – Interesting. It had not occurred to me that the intent might be entirely to create added friction for cross platform authors.

Leave a Reply

Your email address will not be published. Required fields are marked *