Hacker News new | ask | show | jobs
by sieabahlpark 1166 days ago
I looked at Haxe but have trouble figuring out what real benefits it would have over something like Godot at this point.
7 comments

Haxe + https://heaps.io/ (game engine) + https://ldtk.io/ (level editor) presumably gets you most of the features Godot has (though I don't know because I don't really do game-dev)

More importantly the language and IDE support are a lot better than GDScript.

And as others mentioned, Haxe is cross-platform. But not "cross-platform" like some languages claim to be: it's been cross-platform ever since the early days and is very battle-tested

Being able to cross-transpile (cross-compilation basically) to other languages is a huge selling point. You can, in one language, output libraries that are compatible with: JavaScript, Flash, Neko, PHP, C++, Cppia, Java, JVM, C#, Python, Lua, HashLink

For example, wanna deploy a validation library that checks something and have it available in a ton of language directly? Using Haxe, you can get this very cheap.

In practice, this is hard. The problem is that you need to either have all the functionality you use written in Haxe - which is rarely if ever possible - or you have externs to equivalent libraries on all platforms. The libraries produced will also need to be interfaced from outside somehow, and for some of the targets you'll have to write additional wrappers for your lib. It's really hard to pull off when targeting more than 2-3 targets.

Another commenter linked to Ammer[1], a universal FFI framework (apparently, it's my first time seeing it) - it might be just the thing needed to make multiplatform Haxe libraries way easier to write and distribute. I'd welcome that :)

[1] https://aurel300.github.io/ammer/

Haxe's double-edged sword that it lets you approach cross-platform in an uncompromising fashion where you're really getting as close to the target as reasonably possible, while also abstracting away as much of it as possible, but it also directly exposes you to the high level of engineering effort necessary to achieve that.

A lot of what I encountered from my time using it(which I might return to someday) was that it became more irritating as you introduced more platform dependencies, but mostly because it became harder to build the project. And this was disproportionately true for targets with complex build processes(SWF was one of them back in the day, and C++ still is).

Some of it does get mitigated by doing a double layer of abstraction: your platform code has a shell of functionality that is handled using the native paradigms, but exposes an interface that Haxe code calls. And the Haxe code accesses your own abstractions, not the native ones.

But doing all of that can get away from "just getting a result", because then you're pushing more of the development onto the native target. If you don't have a clear view of what abstraction you want, you can get stuck on designing it.

Haxe has been, and continues to be, used to ship commercially successful games.
Could you share some examples?
Friday Night Funkin' got pretty huge for a while there. Open source, too (not sure about the license) https://github.com/FunkinCrew/Funkin
All games by Shiro games (founded by Nicolas Cannasse, creator of Haxe) : https://en.wikipedia.org/wiki/Shiro_Games
Oh wow. Dune: Spice Wars is also in Haxe: https://www.youtube.com/watch?v=pZcKyqLcjzc
Dead Cells, Papers Please, Dicey Dungeons
Northgard, not an amazing game to me, but successful nonetheless.
Defender's Quest is a little famous, though not enormously famous.
Dead cells is the most recent and prominent example.
Haxe appeals to a lot of Flash game developers that would prefer to rely more heavily on code than a full blown game engine. A lot of people really like the “display list” (scene graph) API of Flash and a bunch of Haxe libraries follow similar patterns.
Haxe is a programming language and Godot a game engine?
Dead Cells was written in Haxe.
Paper Please too.
To add to this, the creator also used Haxe to port to Unity: https://dukope.com/devlogs/papers-please/mobile/
Lucas Pope's dev logs are great.
I mean it's like why does one brand of automobiles is better than another brand of automobiles? Should we just have one brand?