93 points · by -yukari · 1y ago · 21 comments
Haxe is a fun language. It could have taken TypeScript's place, if they focused on improving the tooling and ergonomics for Web developement instead of game development 15 years ago.
It was heavily inspired by ActionScript 3 which was the basis for the EcmaScript 4 proposal abandoned around 2008 iirc.
We could have had something close to TS running natively in the browser 17 years ago.
What we really needed was Flex or XAML or Swing or even XUL, for that matter, to be built on a sandbox functional enough to make users happy but robust enough to run on the web. Instead each framework failed in turn to various platform dependency and/or security flaws until we ended up stuck with the DOM as our endgame.
And yet we're drowned in build tools, configs, and whatnot to use TS because JS is not sufficient to write sophisticated client-side apps.
Even if there was something like XAML you'd still need a typed language.
What's interesting is
- surely it's inspired by actionscript (Flash) because it has a flash-compiler-predesscors, MTASC (Motion-Twin Actionscript Compiler), which was slightly faster than native flash! (slightly more optimized code)
- you may recognize that name, Motion Twin... this guy was their compiler guy, but this was a Flash games company.. still around today, some of you may have played their multi-platform game, "Dead Cells"
It's really cool that it can compile itself to a bunch of different languages, but the API isn't consistent enough for complex applications to work with all of its backends.
Then what is it good for? Just simple apps?
It's an OK language for backend server - esp. if you also have a frontend client in the same language (such as the game and the multiplayer server backend).
It fits the niche of people who have legacy applications written in Flash, and want to rewrite them in a modern stack. There's a battle tested, free, cross-platform implementation of the Flash API called OpenFL. For people who were familiar with that stack, Haxe offers a natural path to migrate.
So, tl;dr its typical use cases are game development and making legacy Flash projects maintainable.
The C++, JS and Hashlink VM targets are generally well maintained. The situation with libraries is meh, mostly due to being a not-so-mainstream programming language that is almost 20 years old. So, there are a lot of libraries that weren't updated in a decade. Some of them may work on new Haxe versions, some won't. Some have been consistently maintained for very long, but are a one man show and the documentation is often subpar. Ceramic is one of such libraries, although the documentation for it is better than the usual for Haxe, IMO.
Overall I find the language itself amazing and pleasant to use. Kinda wish the C# target was still a thing with first-class support, so we could enjoy their hot reloading.