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

1

13

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?

Avertin answered 7/3, 2011 at 13:1 Comment(4)
Better syntax is arguable. I'm not too crazy about the HaXe syntax, but it's at least usable.Piaffe
@script Agreed, I don't like some parts of HaXe syntax, for example for functions variables.Jauregui
At least usable? not too crazy? functions variables are not ok? Why all that? Can you explain better what you mean here? You are not really motivating your reasons.Bodgie
@Lukasz ... haXe has not the support of a company of the size of Adobe. Still it misses a fully featured IDE that works on multiple OS and has no visual editors for designers. There are probably other reasons but as far as I am concerned it is just perfect for my work.Bodgie
B
16

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.
Bodgie answered 7/3, 2011 at 14:25 Comment(3)
Thanks, that's a great answer. Can you give some reference on "gym" required for library use?Platinize
I also added one more question, you may want to relate to that.Platinize
Honestly I can't :) ... the last time I tried (and we talk more than a couple of years ago) ) had problems with domains and making flex code work properly. It is very possibile that now that process can be easier. When I will have the time I will try to give it another go.Bodgie

© 2022 - 2024 — McMap. All rights reserved.