Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the pro and cons of using Haxe over Actionscript-3?

I'm thinking about using Haxe in place of AS3.
What are the disadventages of that? I can think about:

  • Difficulties with using native AS3 libraries.
  • Difficulity of debugging after language translation.
  • Haxe is quite young, it may have some rough edges. Does it?

Does any one of you have expirience with Haxe dark sides?

What are the adventages? I've heard:

  • Performance.
  • Multiple targets (But I don't see how that is useful)
  • Better typing that AS3
  • Maybe better syntax.

Haxe is big enough that there should be more. What are the pros of Haxe?

Edit:
If there are no real disadvantages then why Haxe is not replacing AS3?

like image 289
Łukasz Lew Avatar asked Mar 07 '11 13:03

Łukasz Lew


1 Answers

Your first point is surely true. Some "native" libraries (such as Flex) may require a little of gym to be included in your project. In the vast majority of cases it is a quite smooth process. Haxe supports multiple -swf-lib which permit to have the code of the imported assets immediately available in your application. Note that the imported libs are not just embedded but are recognized as code asset, so if your IDE is integrated with Haxe you will have type completion for that too.

About the debugging there are no issues at all for the translation, that because the language is not translated to AS3 but directly compiled to AVM2 bytecode. When the -debug switch is on, the full stack trace with source code references (filename, line and position) is fully preserved. An uncaught exception will point you exactly at the line of code that generated it.

Haxe is not really that young and for sure the AVM2 output is the one with the best support of all. There are no rough edges in my opinion.

Of the pros you have outlined I want to underline that multiple targets can be huge. Of course to take really advantage of it you can't really rely on external libs specific for AS3. Even so there are always big chunks of code that you want/can reuse across projects.

To mention a few other advantages:

  • macros are a recent addition which add a huge pool of possibilities.
  • Molehill API is already available for Haxe (SVN version) and Nicolas is working on a Shader system that makes it even bigger.
  • Haxe is evolving constantly bringing new (important) features at each release.
like image 89
Franco Ponticelli Avatar answered Nov 12 '22 12:11

Franco Ponticelli