Hacker News new | past | comments | ask | show | jobs | submit login

Haxe sounds too good to be true. Why would anyone use any of the other game engines out there which are targeted towards the mobile world if they could use Haxe? I see many half-donejavascript frameworks and fully-baked lua frameworks...what do they provide that Haxe doesn't? Can anyone who has done significant Haxe work comment to some of the benefits and drawbacks? I ask as someone in search of a gaming engine which can target iOS and Android, so this is very interesting to me.

Thanks.




First, a distinction between frameworks and languages... Framework benefits include rapid development, and familiarity (since they use preexisting languages). The cost is that performance will never be as good as native code, and you won't be able to easily change certain behaviors.

The Haxe language gives you far more flexibility and performance optimizations, since it is generating optimized native source or byte code. The cost is that you have to learn the Haxe language.

Many people on this discussion are criticizing the java-style syntax of Haxe. I think most of these negative feelings are due to the excessive boilerplate required for many Java classes. Haxe does away with a lot of boilerplate code using type inference and other modern compiler techniques. http://haxe.org/ref/type_infer

You can remove even more boilerplate with macro libraries for shorthand class declarations: https://github.com/back2dos/tinkerbell/wiki/tink_lang

There are many other tricks you can use to define behavior without resorting to complex inheritance or class definitions. One of my favorites is the "using" declaration: http://haxe.org/manual/using

So, in my opinion, the cost of learning Haxe is very low if you already know Java or Actionscript. The cost of coding/writing Haxe is also very low, since you're not required to write boilerplate code.

Finally, it's worth mentioning that the Haxe developers are not just trying to gloss over the technicalities of each underlying platform in order to get things working. They really understand the behavior of each platform, and make many conscientious decisions based on considerations for performance and cross-platform consistency. I've learned more from the Haxe language google group about each target (js quirks, java limitations, etc.) than I have from the Java, JS, Actionscript groups themselves: https://groups.google.com/forum/#!forum/haxelang Many people have remarked that simply following the Haxe development list has made them a better programmer.


I used haxe for all my games(e.g. http://cardinalquest.com/) for over a year now & it's working quite well.

There are some annoying differences between the different targets but it's >99% the same and you can work around the differences.


Cardinal Quest looks very cool. Could you share some light from business perspective. Profits?

Thanks.


Revenue is mid 5 figure so far from desktop and flash versions, the ios & android version were just released but I'm hoping to break into 6 figures altogether across the game's total lifespan.


Did you use Haxe for the iOS and Android versions as well? It wasn't quite there yet when I checked it out a couple of years ago.


Yep, all from the same code base.


Thanks, I'll go and play with Haxe again then!


May I ask you regarding the percentages you get from the desktop Linux vs Win vs MacOSX sales?


I don't collect these stats, although probably should. From web visitors it's 70% win, 20% mac, 10% linux.


I made a soft-synthesis and MIDI playback engine in Haxe targeting Flash:

http://www.ludamix.com/apps/triad-synth/index.html

Haven't done an official port yet, but one of the NME devs did look into using it to test the SampleDataEvent API on other targets. I did get it compiling but not running, so the ports probably won't be a huge project.

I like a lot of things about Haxe. The syntax is more streamlined than traditional curly-bracers. The type system can massively help with refactoring. It's "honest" about the limitations of targets - you get the APIs pretty much exactly as they are on the target itself. The compiler is well-implemented and updated all the time. It's just a very productive environment, and although it used to have lots of maturity/ecosystem issues, increasingly those aren't a major hurdle, at least for the game space.


I tried a bunch of different game engines, toolkits, frameworks, languages, etc. for the game I'm working on and the thing that sold me on Haxe was NME. I was able to build for Mac and Flash without changing my code. I simply specified a different target platform at the command line. I haven't built for mobile yet, but I suspect there won't be very many changes to my code when I do.

Also, the Haxe community is full of great hackers and incredibly helpful.


> Why would anyone use any of the other game engines out there which are targeted towards the mobile world if they could use Haxe?

Haxe isn't a game engine. It's a language that compiles into other languages.


Not entirely true, it depends on the platform.

While compiling to JavaScript obviously results in JavaScript code (which is what the browser can understand), but compiling to Flash does not compile to ActionScript 3 and then the flash assembly (the .swf file). It goes straight from HaXe to the flash assembly.

Likewise, the Java target (which is still in development) won't merely translate HaXe into Java and then compile that Java. I've seen solutions like that and it's not fast or elegant.


Yes, but the point was that haXe is not a game engine.


But it has a physics engine, a canvas, etc. I'm not a game developer (yet ;-) ), so I'm curious...what defines a game engine in your mind? What is haxe lacking? Thanks.


There is more than one physics lib for Haxe and they are separate to the language, the canvas referenced may well be the canvas in the HTML5 compile target or are you mentioning the display list. You don't even have to use that if you target c++, neko or haxe because of another lib; waxe.

Haxe is a language and you can browse the libs available for its compile targets at http://lib.haxe.org/.

If you want to find out more about a framework that uses Haxe and is oriented towards mobile gaming (but not only towards that) checkout HaxeNME.

If you want a nice mature game engine lib built for Haxe try awe6 in the search at http://lib.haxe.org.

Haxe isn't lacking in the game engine department, thing is you can use Haxe with externals for node.js, a lib like noxe that extends haxe to node or simply use whatever javascript lib you feel like and output js. Or use the pure data lib to interact with mobile. Haxe isn't restricted to gaming. It's just one of the things the language allows for.


What you are asking is akin to asking what English is lacking to become a poem. HaXe is a language, not an engine.


First, haXe describes itself as a programming language.

Second, I don't see a mention of a physics engine builtin to haXe anywhere on the features page,

http://haxe.org/doc/features

where are you seeing that?


You're correct. I saw this earlier, but apparently it's not included in Haxe core:

http://haxe.org/com/libs/physaxe


Arguably the best 2d physics engine, http://deltaluca.me.uk/ is made with HaXe.


Better than Box2D..? (C++, various ports)


Yeah, played with both.


A problem I have had with these frameworks is that they all sound great on the surface but when you start using them you run into issues or missing features that are important to you and sometimes there's nothing you can do about it.

Haxe does look great and for this particular case I wonder how Haxe NME's performance compares to the lua frameworks like Corona and Gideros for mobile development specifically.


Last I compared against Corona, NME was getting 7 times the performance.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: