A Quoran wants to know about Haxe

I think that the last comment made to that Quora says it all: fundamentally, Haxe is cross-compiler which can more-or-less seamlessly target a number of different platforms from just one source-code base. It is also a very strong language that can detect many, many errors at compile time.

As a simple example, I once inherited a god-awful mess that consisted of seven Flash programs, JavaScript that was supposed to talk to them all, and server-side code with which the JavaScript was supposed to communicate. Nothing worked, and it was all separately-written and separately-maintained. I was able to convince the client to let me “re-imagine” the whole thing in Haxe, which I did in about a month and a half.

Now, I had one code-base which generated everything. Furthermore, since Haxe now had a holistic view of every component, and because they all communicated using Haxe modules that ran on all three platforms, Haxe could detect many subtle problems at compile time: where two sides talked to each other, it was simultaneously aware of what both sides were doing. I built them all and deployed them all and … I think, for the very first time in this poor application’s entire history … “everything worked.” And, from Haxe’s point of view, it was one very big program that compiled-out to nine target files. One thing for me to maintain, not nine.

Later, I was working on “another god-forsaken application,” this time one that was trying to use five or six big JavaScript libraries to create a – well, a “web-site in drag” … :roll_eyes: … mobile game. The libraries, many of which actually contributed very little, knew nothing of each other and interfered with each other. Once again, I re-did the whole thing in Haxe. It turned out to be much faster to “do it right” than to keep hammering my head against the past. Haxe’s optimizing compiler now inserted into the output exactly the JavaScript that the program needed, and I was able to eliminate dependency on all-but-one of the original external libraries. Once again, errors were detected at compile time which otherwise would have had to be ferreted-out dynamically in the web browser, if they were detected at all.

The client is now considering whether to deploy native versions of their system (which wouldn’t be web-technology based), or WebAssembly, or … or … or … and the reason why they are now able to reasonably consider such a thing is Haxe. They actually could deploy a native version to Android and iOS and to other platforms, without rewriting it. That’s unprecedented. The value of their investment in source-code just multiplied.

Haxe is a very powerful post-modern system that actually does what its backers say it will do. It is a significantly better and more-productive way to do a great many things, and it has very broad application. As a professional programmer of more than 30 years’ experience, I will very-flatly say: “You must learn Haxe. And, you will not look back.”

13 Likes