November 2009 Archives

Cross-Compiling Java/C#/Ruby to iPhone

| No Comments
(This is a posting I started a while back (on my brother's b-day in May) but didn't publish at the time... don't remember why.)

Cross-Compiling C/C++ to Actionscript using Alchemy

As you may well know, Adobe Labs has developed an exciting tool called Alchemy that leverages the LLVM open source project to cross-compile C/C++ code to a common run-time byte code. This byte-code is then cross-compiled to Actionscript code which is then compiled to Actionscript byte code (ABC). The earliest and most striking example of what can be accomplished with Alchemy was the port of Doom to Flash that Dave released on Newgrounds within a week of Alchemy's launch. He has now released the Doom Triple Pack which includes the bad boys Doom, Heretic and Hexen.

The good people of Automata Studios helped Adobe develop one of the first projects for demonstrating how Alchemy works. Here is their write-up on the subject.

Cross-Compiling to Objective-C (and more!) Using XML-VM

overview.jpg
Another development that has come down the pipe is some research done by Arno Puder and his colleagues at San Fancisco State University. Their work involves using open-source tools to transform code from one language (e.g. Java, C#) to an intermediate XML format which can then be transformed to another language (in this example, Objective-C). The project is called XMLVM.

Prof. Puder presented how all of this works at the Google offices and the video of this presentation is available on YouTube. It is a very cool idea and demonstrates once again (as all software does, really) the potential aggregate power of using many small, simple constructs. Byte code statements are converted to an XML format which can then be transformed to Objective-C. While the final code might not be as optimal as the original, it will do the same thing. My guess is that the toughest part would probably be handling language elements that don't exist in both the source and target languages (i.e. garbage collection, loose typing/auto-boxing, annotations). Perhaps you'd have to do away with overly "native" parts of a language language when writing the "from" code. The good professor covers part of this challenge in his presentation. 

While the target language discussed is Objective-C, as you can see from the diagram above, the XMLVM project allows you to cross-compile to and from a number of different languages.



About this Archive

This page is an archive of entries from November 2009 listed from newest to oldest.

June 2009 is the previous archive.

December 2009 is the next archive.

Find recent content on the main index or look in the archives to find all content.