The Blog

Feb 15, 2009

Cross-Compiling Java to ActionScript 3 

by Maxim Porges @ 2:14 PM | Link | Feedback (1)

While in the shower one day this week, I was contemplating how hard it would be to add Java cross-compile support to Loom, but it seems like the Eclipse guys have already got this covered.

I'm not sure what level the cross-compile is implemented at in E4; my intention for Loom had potentially been opcode-to-opcode, with the appropriate language feature trade-off where applicable. I don't have any serious plans for cross-compiling in Loom, but it seems entirely possible.

In the case of basic use cases, cross-compiling at the bytecode level could be interesting. The original idea I was contemplating was being able to send a Java class across the wire over AMF and load its class definition in to memory in the ActionScript virtual machine, complete with its instruction set. There would be huge problems trying to send classes with references to OS-level components (such as files or network sockets), but since the AMF gateway is usually used for sending value objects I was thinking of something along the line of transmitting classes that adhered to a validation framework implemented on both sides of the wire (think OVal for AS3).

Again, I have nothing particularly serious planned - this is just the sort of stuff I ponder when performing mundane activities.