30 Aug 2009 @ 2:52 PM 

So i haven’t been working on Haxer too much lately, mostly because i’ve hit a wall as far how to best convert some AS3 code to Haxe without having to implement a full parser/lexer. The main area i am struggling with is converting “o is Object” and “o as Object”  which sounds trivial at first, but when you look at the myriad of possible ways those statements can appear in code, it becomes a much more complex task.

In HaXe, the “is” operator/keyword/whatever it is, is written as “Std.is(obj, type)”  and the “as” operator is written as “cast(obj, type)”. This presents quite a challenge when you have lines like this in AS3:

  1. if(other is fObject && !(other.customData.flash9Renderer as fFlash9ObjectRenderer).eraseShadows) {

There are other, more complicated examples that make using regular expressions nearly impossible. I am open to a discussion as to how i might be able to implement such a conversion.

Posted By: Atmospherian
Last Edit: 30 Aug 2009 @ 02:52 PM

EmailPermalinkComments (2)
Tags
Tags: , , ,
Categories: Haxer, Projects, haXe, java
 15 Jul 2009 @ 6:37 PM 

With the rewrite of my as3 to haxe translator in Java, i have also renamed the program ‘Haxer’. It just sounds a whole lot cooler. The current version of the code is up on git hub. Right now it only knows how to skip comments, detect and convert types correctly. I *think* i’ve managed to nail down the best way to do the type refactoring without having to loop over everything a bunch of times. So far the results look promising.

Posted By: Atmospherian
Last Edit: 15 Jul 2009 @ 06:37 PM

EmailPermalinkComments (3)
Tags
Categories: Haxer, Projects, java
 14 Jul 2009 @ 7:33 PM 

So over the last few days i’ve been looking at the output that was being generated by my first attempt at writing an As3tohaxe translator. The results have been inconsistent to say the least. Not inconsistent in terms of different results everytime i ran it, but inconsistent within a file itself. Some variable definitions would get updated, while others would not. Some for loops would be translated, and others wouldn’t. Now normally it would be easy to step though the code and see why this is happening, but in haXe and neko there is no debugger. The only thing you can do is litter your code with println’s all over the place, which isn’t really all that helpful.

I thought it would be cool to write the program in the target language of its output, but given this rather significant shortcoming to the development environment, something more robust and mature is needed. Enter Java and Scala. Combined with IntelliJ (my favorite Java IDE) I’ve begun re-writting the program with the help of the built-in debugger. I thought it would be interesting to take this opportunity to learn Scala at the same time, but that is proving to be a bit challenging as Scala’s syntax flirts with both OO and Functional paradigms, it’s proving a bit difficult to wrap my head around. So for the time being the code is a mix of Scala and Java while i learn more about Scala and how to apply its strengths to this project. As Steve McConnell would say, you have to program into your language, not in it. What he means is using the features of the language you are writting in to make accomplishing your goals easier. Instead of applying the same algorithms and methodologies with just different syntax.

So with this new approach in mind i am now in the process of re-designing the program and will hopefully have some better results to report in a few days.

Posted By: Atmospherian
Last Edit: 14 Jul 2009 @ 07:33 PM

EmailPermalinkComments (0)
Tags
Categories: As3toHaxe, haXe, java
Change Theme...
  • Users » 4
  • Posts/Pages » 25
  • Comments » 29
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

About Me



    No Child Pages.

Projects



    No Child Pages.

Downloads



    No Child Pages.