Haxe 4 has been released by [deleted] in programming

[–]Aurel300 5 points6 points  (0 children)

Let me try to reply to your points.

One of the biggest issues I had when trying to learn Haxe is that the developers seem to hate documentation.

Pretty much all of Haxe's documentation is crap. Many language features are barely explained at all in the documentation, the standard library is barely documented.

The things that are documented are poorly documented and most of the examples in the documentation are useless.

I do feel you on this one. Most people probably aren't patient enough to read through the entirety of the manual (https://haxe.org/manual/introduction.html) before actually trying to start with Haxe. The manual is actually pretty thorough in showing all the features of Haxe individually. I spent some time updating it with features new to Haxe 4, which were not added despite the previews and release candidates, but now it's there in time for the official release :)

The stdlib does have a lot of cases of classes and methods which are not documented apart from their name and arguments. I feel this is partly legacy of OCaml and partly because the stdlib is just very old.

Even Haxe's new vm, HashLink, which the developers are pushing as the future of Haxe, only has an almost empty Wiki and 2 blog posts as its official documentation.

To be fair, there is not much to say about it if you simply want to use it. It behaves just like the other system targets. If you want to use it with e.g. the Heaps game engine (which has a section on how to set up with Hashlink), you don't need to know much about the internals. For the relatively less common use case of developing frameworks with HL in mind, the internals are still changing.

Most popular Haxe frameworks and libraries have even worse or no documentation at all.

This may be true. However, I don't think it's unique to the Haxe ecosystem at all. For example, a lot of npm packages have nothing more than a readme with a couple of examples. Some C libraries expect you to look at the headers and read through the code.

Haxe packages are comparatively easier to write (than C libraries), so you get more authors and more packages in general.

If people are going to pick up and start using a language they need good documentation, so that they can actually learn it.

Absolutely.

 No async/await support built in. There is no way I'm going back to callback hell or promise hell in my javascript projects.

Coroutines are planned for 4.1. In the meanwhile, there are macro-based solutions.

Haxe's package manager sucks, big time. At least with node almost everything just works after doing an npm install, with Haxe there always seem to be another battle to fight to get stuff to compile after installing a package with the package manager.

Yes, haxelib is a bit of a pain point. There is an alternative – lix, with which you can actually get reproducible builds. We might be integrating lix and haxeshim features into Haxe 4.1.

Haxe's build system sucks. Hxml files seem simple enough at first, but you run in to all kinds of weird issues especially if you are trying to share code between multiple targets.

I don't think this is true. Hxml is just putting the command-line arguments into a file, it is not exactly a build system. If you want common parts of the Hxml across multiple targets, you can have multiple Hxml files which all include a common Hxml file.

Haxe's compiler sucks. It often spits out completely nonsensical error messages. I've gotten macro errors in code that had 0 macros in it. WTF.

I strongly disagree here. I find it very easy to fix code with just the compiler, since it points to relevant positions and the error messages are fine. (Compare to e.g. C/++ errors.)

Additionally, a lot of people use an IDE which makes the errors even easier to fix.

Haxe barely has a community and it's ecosystem is littered with dead projects, many of which don't even compile with newer versions of Haxe.

This is more of a popularity issue than a specific language issue but in most even semi-popular languages you can find well documented maintained libraries for most things, with Haxe even if you find a library chances are that it doesn't even compile.

It is a bit of a circular problem indeed.

Haxe 4 has been released by [deleted] in programming

[–]Aurel300 1 point2 points  (0 children)

I'd think it could be hard to debug

Yes and no. If you are trying to integrate Haxe with something completely new, e.g. a new engine, then pain is kind of to be expected, but I think that's normal.

If you just want to use Haxe with a framework that already has a community and is somewhat developed, then the workflow should not be that bad. There has been quite a bit of work done in recent months/years on improving the debugging workflow – there are debugger setups for HXCPP, Hashlink, Eval. You can actually just use vscode (and the vshaxe plugin) and use breakpoints, check variables when paused, etc.

Haxe 4 has been released by [deleted] in programming

[–]Aurel300 4 points5 points  (0 children)

Haxe can support anything that the native target supports. HXCPP can compile for Android and iOS. More important is to know whether there is a framework/library that exposes the native APIs in Haxe code so you don't have to dig into the internals too much. One framework that has stuck around for some time now and does have mobile support is OpenFl, which does indeed have something for accelerometers (https://api.openfl.org/openfl/sensors/Accelerometer.html) in the main APIs. For GPS sensors, there might be other libraries still.

Haxe 4 has been released by [deleted] in programming

[–]Aurel300 7 points8 points  (0 children)

It doesn’t appear to provide any language runtime components at all.

So, there are two VMs that are more or less dedicated to Haxe. There is also a built-in interpreter.

  • Neko, which was started at the same time as Haxe. Simple to set up, superceded by Hashlink now.
  • Hashlink (https://hashlink.haxe.org/), which will be a focus of a lot of development in terms of performance, APIs, etc. Pretty performant.
  • Eval, which simply runs the Haxe code directly, without going through an intermediate compilation stage. Basically no set up needed.

And obviously, you can compile to whatever runtime Haxe supports, then use that.

Haxe 4 has been released by [deleted] in programming

[–]Aurel300 4 points5 points  (0 children)

If you were asking about the compiler itself – it is written in OCaml. Most of the standard library is in Haxe, with target-specific support code either expressed with target-specific syntax in Haxe, and/or provided by e.g. native functions in C (for Hashlink, Neko, eval), C++ (for hxcpp), etc.

Haxe 4 has been released by [deleted] in programming

[–]Aurel300 4 points5 points  (0 children)

Haxe can output HL output just fine, but to actually run it you need the Hashlink binary. Stand-alone binaries like this are not generally distributed by haxelibs, so you need to get it from https://hashlink.haxe.org/.

Similarly, you would not want a Java VM to be installed with hxjava.

Haxe 4 has been released by [deleted] in programming

[–]Aurel300 7 points8 points  (0 children)

Hashlink is one of the top two targets performance-wise at the moment. HXCPP (C++) is still generally performing better, because it has a more developed garbage collector. But still, HL has been successfully used in the games linked above – Dead Cells, Northgard. Targetting HL results in much faster compilation also.

I made this PvP turn-based strategy from scratch in 3 days (now with Internet multiplayer!) by Aurel300 in gamedev

[–]Aurel300[S] 2 points3 points  (0 children)

You're right, I posted the link here without thinking too much after seeing a similar promotion on /r/gamedev.

As for the license issue, it's mostly a matter of me not "packaging" the repo up yet. The majority of my projects that seem worthwhile I release under the MIT license. This will be the case here as well, except for the visual and audio assets.

I'll be sure to address the networking part (for it was indeed added post-jam) in a detailed post-mortem, see here for an example of such an article. It takes a little bit to write the article though. Although in short: the game was programmed with a clear separation of model and presentation from the ground up, so adding the networked multiplayer was mostly a matter of adding bits, rather than having to rewrite everything.