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?

Łukasz Lew
  • 48,526
  • 41
  • 139
  • 208
  • Better syntax is arguable. I'm not too crazy about the HaXe syntax, but it's at least usable. – scriptocalypse Mar 07 '11 at 14:56
  • @script Agreed, I don't like some parts of HaXe syntax, for example for functions variables. –  Mar 07 '11 at 18:13
  • 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. – Franco Ponticelli Mar 09 '11 at 23:17
  • @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. – Franco Ponticelli Mar 09 '11 at 23:20

1 Answers1

17

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.
Gama11
  • 31,714
  • 9
  • 78
  • 100
Franco Ponticelli
  • 4,430
  • 1
  • 21
  • 24
  • 1
    Thanks, that's a great answer. Can you give some reference on "gym" required for library use? – Łukasz Lew Mar 07 '11 at 18:08
  • I also added one more question, you may want to relate to that. – Łukasz Lew Mar 07 '11 at 18:11
  • 1
    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. – Franco Ponticelli Mar 08 '11 at 10:00