innogames / ax3

AS3 to Haxe converter
MIT License
44 stars 10 forks source link

ax3

This is an AS3 to Haxe converter that tries to be very smart and precise about rewriting code. To achieve that, it actually resembles the typical compiler a lot, so here's how it works:

DISCLAIMER

This tool was developed and used by InnoGames to migrate our ActionScript 3 codebases. Feel free to ask questions, fork and contribute fixes. However, we are NOT planning to maintain and provide official support for this project.

Usage:

java -jar converter.jar config.json

where config.json is something like:

{
  "src": "<as3 sources>",
  "hxout": "<hx output>",
  "swc": [
    "playerglobal32_0.swc",
    "<other swc libraries>"
  ]
}

Known limitations

Building

The converter is written in Haxe 4 and is only one library, format, for reading the SWC files. To make it easy there's a Lix scope configured, so assuming you have nodejs installed, you can do:

It uses the Java target (actually, even the new JVM bytecode target), because JVM has great GC and handles unoptimized functional code of this converter very well. Originally I used JS target, but node.js worked slower and eventually died on so many allocations. :)

TODO

Most of the TODOs are actually in the code, so look there too, but still: