Building MMOG’s for the Flash Platform – AS3 to Java Byte-code Compiler
Whoa, long time no post about this subject. My apologies. This one won’t be long either, but I just had to share this freakin’ cool thing.
You might have read before that one big part of our MMOG Platform is the ability to write all code in AS3. Client-side as well as Server side. As there is no real AS3 server-side technology available we had to write our own. Our first version was up and running almost a year ago. Performance back then was OK, our tests showed us that our compiler could generate Java Byte-code from AS3 that ran as quickly as AS3 in the Flash Player, and included almost all core functionality of the AS3 scripting language.
Jump forward a year and now we have our second version of our compiler up and running (well, compiling). And boy is it fast. When you write decent code with type annotations and all, the compiler will churn out almost perfect Java Byte-code without pushing anything on the stack.
Performance?
Our simple (and yeah, a bit biased I must say) test suite with heavy calculations performed wonderfully. We ran the same test suite in the Flash Player and in it’s compiled form from the command line (compiling from the same source code of course).
All I can say is wow. Optimally, our AS3 to Java compiler produces byte code that runs 900 times faster than ActionScript in the Flash Player. 900 times.
This of course won’t hold true in the real world where we pass around closures, dynamic objects and other resource hogs. But from what we can gather it should be around 100 times faster even then. Stay tuned for some real world tests once we get to those.
2 Comments
Vattenfall, please explain yourself
I just moved, and started to compare prices for electricity. Vattenfall has a great number of options to choose from. You can choose with what method the electricity you’re buying has been produced. Nuclear, wind, water or “basic” (=nuclear, fossil, wind & water). Now, the pricing for wind generated power is a bit higher than for the other options, but what was really surprising was that the “basic” option, which is powered by fossil fuels in addition to clean energy is priced the same as electricity that has been generated 100% from water power.
My question is, why the hell does Vattenfall have an option that includes fossil fuels when there is a clean option at the same price point?








Hello Artman, the article is actually very interesting, or rather it ssubject is. Any chance I could get my hands on an AS3 to Java compiler (might we call it some cool name, like Ajas or Javas?) , either as free or commercial software?
Hi Ivan, stay tuned for updates. You might be able to use it soon…