About Haxe

Continuing the discussion from Armory vs Godot:

You can definitely use Haxe to write desktop applications, server-side applications, CLIs, games, web apps, and maybe embedded applications with the C target. An operating system might be outside of its range, unless you still wrote some C/C++ or something like that along with it.

Haxe is a high level language that requires a garbage collector so you can’t manage memory manually like you can in Rust or C++.

Haxe works by compiling to other languages including C++, C ( though HashLink C ), PHP, Python, Java, and Javascript. Armory uses the C and Javascript targets.

1 Like

I think that it’s extremely important to understand what "Haxe, in particular(!)" sets out to be.

Haxe is a cross-platform development environment that specifically sets out to target multiple very-different environments from a single source-code file. For instance, you should expect to be able to write one program and then deploy it … natively(!) … to (say …) “Flash, HTML5, iOS, and Android.” All without changing the source-code file. (Of course, koff koff, “this is the ideal …” but Haxe usually comes dammmm close.)

The way that Haxe does this – in most, but not all, cases – is by generating source-code as output. This source-code is then fed to the platform’s native compiler, if there is one.

(But for some “targets” it simply generates the appropriate byte-code. For instance, Haxe is a much better “Flash compiler” than Adobe ever managed to produce!)

And – it actually works.


Also, it’s important to realize: from Haxe’s perspective, Armory3D is simply "yet another package." (As are “Kha” and “Iron.”) Haxe is a general-purpose tool, which I have used for many years now in other contexts completely unrelated to computer graphics.

(Let me put it this way – “I haven’t written a single line of JavaScript ‘by hand’ in a very long time, and I never intend to do so again.”)


(“Computer graphics isn’t your day-job [yet]?”) Pay attention to Haxe, regardless! You’ll be very glad you did. (And, pay attention to Armory, too – you’re in on the ground-floor of a thing that’s soon going to be what everyone [else …] is raving about in the industry press.)

They really could have used Rust’s ownership instead of garbage collector as that is really not efficient. Ownership also prevents invalid memory, one way is by preventing data races as it prevents dangling references as one example.

Yeah, I did just a little investigation into Rust a week ago and it looks really nice. Haxe has to be different than rust in many ways because it compiles to a large set of other high level languages such as Java and Python.

1 Like

Oh I see :slight_smile:

Yes indeed it is really nice, that is why I want to ONLY use Rust as I like the language. But it seems to be overcomplicated in Armory for now. I am hoping the devs can change this and make it as simplified as Haxe in terms of programming. Is this possible?

You never know. I think it is possible, but it is hard to tell and I don’t think that it is really high on the list to get working right now.

Haxe is still a very nice language, too. It is by far my favorite out of what I have tried, over C#, Java, Python, and Javascript. It has a great type system, and a very powerful macro system that has allowed me to do things I wouldn’t have been able to do without it. If you have the time I would recommend trying it out.

3 Likes

Sure I will try it out some time later :slight_smile:

1 Like

Haxe being my second programming language (coming from python), i got to say, i really love it. It was really easy to pick up Haxe without having to spend much time wandering around in docs/cookbooks/etc, and is really easy to learn. Haxe’s cross-platform ability is really amazing.

Gonna make pure ray-tracer in pure Haxe when i get some time and export it to as many as possible target just so i can showcase ability of Haxe.

1 Like

I use Haxe a lot in “day jobs” to produce JavaScript that has nothing to do with graphics. Haxe has a very strong type-system which catches many errors “at compile time,” and a very expansive library of contributed programs which – unlike “those endless bloated JS libraries that you somehow need six of” – are compiled into the output, automatically omitting anything that you don’t need this time. Of course there are by now many “JavaScript compilers,” and I quite sincerely think that Haxe is better than Google’s more-famous one.

Memorably, I once had to make-over a ghastly application that consisted of seven Flash programs, tied together by tons of JS that didn’t work, talking to a back-end that also didn’t work. I finally persuaded the client to let me spend two months to “re-imagine” the whole damned thing in Haxe. I was able to generate(!) all of “the pieces aforesaid” from one code-base, and deploy it. The client’s first comment says it all: “OMG! Finally, it all works!”:+1:

1 Like