Please feel free to join it and let the group know what you’re converting or running into any issues.
Update: I’ve uploaded Windows and Mac OSX binaries to the files section of the google group.Read Full Post | Make a Comment ( None so far )
Previously, I attempted to convert the AsWing project with as3tohaxe and decided instead to go after a smaller code base, the as3flickrlib. I spent the majority of the time dealing with converting the xml processing which as3tohaxe doesn’t handle (and I’m not sure ever will), but the rest of the codebase went through for the most part without a hitch. So my conversion efforts are now on github.
Next project is the flare vis kit!Read Full Post | Make a Comment ( None so far )
Since the last blog post, as3tohaxe converter now has expression parsing, “as” converted to “cast ()” calls, and a program, as3tohaxe.hs, to run through a directory recursively and convert!
So I gave the converter the AsWing codebase as its first big test and ran into a couple problems.
The parser was bombing on some unidentifiable characters which turned out to be the UTF8 header sequence “\239\187\191” or EF BB BF in hex. At first I just tried removing those characters but couldn’t with vim because the character is “zero width”. So I used a hex editor, 0xED, and the parser ran without issue. So I’ve updated the lexer to handle the header as whitespace.
The second problem I came across was one file taking a particularly long time converting. I think it has to do with one of the statements which has a nested expression.
((((((((("GridLayout[hgap=") + hgap) + ",vgap=") + vgap) + ",rows=") + rows) + ",cols=") + cols) + "]");
I still need to verify this.
Update: The nested expressions were causing the slowdown. I removed redundant work being done by the parser and got a huge speedup.Read Full Post | Make a Comment ( None so far )
So after a couple of months of study, I finally put together my first Haskell project, as3tohaxe, an Actionscript 3 to haXe converter. And now it’s up on github for everyone. The code is a mess because I’m still green with Haskell (and haXe!). It’s just a start, but I hope to continually improve the translator as I work on my haXe projects.
Here’s what it can do so far:
- converts basic types int to Int
- cleans up the package braces
- renames the constructor to new or main
- converts default arguments
- moves member variable initializers into the constructor
- converts access control attributes (e.g. protected to public)
- and more eventually
Parsing expressions is on the todo list.Read Full Post | Make a Comment ( 2 so far )