Donnerstag, 22. Oktober 2009

Cross-Compilation

Since I am not only studying Computer Science but also try to actively contribute to the Open Source community (e.g. Config4J, JEdit Syntax), I started to look for a way to get Java on my new iPhone. Just little effort in searching revealed that the Apple iPhone doesn't and will probably never support Java natively. Steve Jobs, the guy behind Apple, told the public that nowadays nobody is using Java anymore.

iPhone 3GS has not only x, y, and z axis but also a rotational c-axis!

Well, he can't be further from the truth, especially in the mobile domain. Java is platform independent, and is also available for mobile devices. Java ME is tailored for efficiency and (almost) makes transparent to the developer things like display resolution, Operating System, CPU performance/instruction set, and the capability to display 3D. So, you can easily develop an application with the knowledge that every device which runs a Java Virtual Machine and fulfils the requirments of the used mobile configuration (e.g. CLDC), can execute your program. The keyword is platform portability.

However, Jobs decided to go for a programming language which is almost not known in the world outside of iPhone/Apple: Objective C. It combines the machine-close, procedural language C with concepts from the first object-oriented language Smalltalk. It's definitely worth a closer look, though, for whoever is interested in ancient programming languages.

The "blue" book - Small Talk 80

In any case applications for the iPhone are bound to be "existing" as Objective C code. As I found out, they don't need to be developed in Objective C, though. Arno Puder from the San Francisco State University developed a cross-compiler which takes a Java-program and compiles it into Objective C. So you can actually write your iPhone application in Java. They built a framework on top of it, so that you can even emulate your application in an emulator and compile it for deployment. Puder presented his work during a Google TechTalk. So check out this youtube video.



I really like the idea of developing my application in my favourite programming language (currently Java :) ) and then transform it into a program written in a complete different language, whatsoever. This approach has been taken by Google, too. The Google Web Toolkit (GWT) enables the developer to write is web application completely in Java. The client part is then transformed into highly optimized Java-script code, which uses Ajax to be talking to the server side, which stays plain Java. It comes with a lot of advantages: syntactical safety for client, metapher of using same objects on client and server side, transparency about client-server communication and other low level kinda things.

Leaving the topic now, I want to introduce some kind of ShareMyWorld-link for my following posts. It's purpose is, as the name says, to provide a one-link-summary of what's going on in my humble world. So here we go.

The infamous ShareMyWorld - Link :)

1 Kommentare:

  1. Update: As announced by Jobs Cross-Compilation is no option anymore :/

    AntwortenLöschen