In Simple Terms
Haxe is a programming language that you can use to build games and apps for different platforms. You can build games, mobile apps, etc. Haxe is fast, optimized and also allows programmers to access the platform's native capabilities.
Let's get technical now.
Haxe is a High-Level, Strictly-Typed programming lanague that can build your Haxe source code to different target platforms. Let's say you writing a plugin for JS using Haxe so you can write Haxe code and compile it to JavaScript, it will generate a JS file with the complied code from Haxe source files. Awesome, right?
You can build your React, React Native, etc apps using Haxe. Check their GitHub repo for the supported frameworks.
For JS Developers
You can use Haxe for your JS apps, as you using TypeScript and there is a confusion on which one is the best compile-to-JS to go for.
Well, they are many similar attributes but Haxe is way far more streched. TypeScript is said to be the superset of JS. One of the main features for TypeScript is the type system it has. With TypeScript, you can specify that this variable is of type integer. It has introduced a lot of features other than this one to make JS coding to be more easier and strict. But Haxe is a different beast, it is not only a compile-to-JS language but it compiles to many languages, it uses VMs for other languages and it also has its own interpreter that compiles to Haxe. TypeScript is JS-syntax based, meaning it cannot change the JS syntax and its semantics. TypeScript allows statements with and without semicolons(Can have inconsintent code) and Haxe doesn't, you have to end a statement with a semicolon. Haxe is optimized, it has dead-code-elimination, the removal of unused code, which means small sized output file and fast execution, etc. Haxe supports macros like C, C++. We can rant all day about their differences but they are similar but haxe is more of a beast since it has more features.
Installation
For you Windows Users, you can get the Windows Installer on the Haxe website.
For us, Linux users, you can get their binaries on the Haxe websites, add their PPA repo, update packages, install Haxe and build it. Done!!!
Hello World in Haxe
Let's look at the famous program in the programming industry.
class Main {
static function main() {
Sys.println("Hello Philne from Haxe");
}
}
To run this using the Haxe interpreter:
haxe --main main.hx --interp
Conclusion
Haxe is a great language and programmers can take its features to advantage and use it to build powerful and optimized apps. Happly Coding.