Per Ars: Sun is talking about porting Java to the iPhone (and an idea for python)

by jesse in , , , ,


coffee poster.pngOk. So Sun has come out stating they're starting work based on the SDK released by Apple for the iPhone earlier this week to port the JDK over to the iPhone. Quoting the sun rep:

"Now, the iPhone is open" as a target platform, Klein said. The free JVM would be made available via Apple's AppStore marketplace for third-party applications.

Now, as comments there and elsewhere have pointed out - there's a clause in the Agreement that comes with the SDK forbidding applications from being placed on the AppStore that can execute/interpret "other applications" - to whit:

3.3.2) An Application may not itself install or launch other executable code by any means, including without limitation through the use of a plug-in architecture, calling other frameworks, other APIs or otherwise. No interpreted code may be downloaded and used in an Application except for code that is interpreted and run by Apple's Published APIs and builtin interpreter(s).

So - unless Sun plans on making a JDK that a) doesn't run anything or b) can be compiled into an application that is to be sold on the AppStore (providing the runtime for the app, like a self-standing .jar/.war) then I can't see this happening, and option a is about as useful as a toilet bowl filled with taco meat.theoffice.jpg

On the other hand, option b: Making a runtime they release outside of the app store for application developers to use to write an application in Java and then have it compile-down to an Objective-C runtime/bytecode binary - then it could work, but those would be some *fat* binaries without a lot of magic.

Now - could the same thing be done with Python? Perhaps. Right now we have the pyObjC bridge that ships with Leopard that allows you mostly unfettered access into the Objective-C/OSX programming environment. This means you can build "native" applications in Python.

I doubt these bindings will work/exist on the iPhone, which means you want some utility to take Python code and "interpret" it down into an Objective-C binary, i.e.: an embed-able environment ala what Sun may end up having to do where you write an app in pyObjC/Python and the app+runtime is compiled down into Objective-C.

Again, without a lot of trickery, these would be fatass binaries - probably fatter than the notion of the universal binaries most people ship nowadays for OS/X.

It's a thought - now I should get back to poking at Objective-C and other pre-pycon hackery. This is something people more versed in compilers, runtimes and with more free time than me will probably explore.