Haxe can build cross-platform applications targeting JavaScript, C++, C#, Java, JVM, Python, Lua, PHP, Flash, and allows access to each platform's native capabilities. Haxe has its own VMs (HashLink and NekoVM) but can also run in interpreted mode. Code written in Haxe can be compiled to any target Haxe supports.
Haxe is an open source, multiplatform programming language that allows developers to JavaScript, C++, C#, Java, JVM, Python, Lua, PHP, Flash, NekoVM and HashLink using the same syntax.
Haxe includes a set of common functionality that is supported across all platforms, such as numeric data types, text, arrays, binary and some common file formats. Haxe also includes platform-specific APIs. It can be integrated with existing libraries using extern definitions (e.g: JavaScript) or leveraging the compiler to connect directly to native libraries (e.g: .jar
for Java and .dll
for C#).
Haxe can also compile to bytecode (Neko, HashLink or JVM), which runs in the runtime created by the same developer.
Haxe is a garbage-collected language. Some target platforms do not have a native garbage collector - in those cases Haxe provides its own runtime, like hxcpp in the case of C++, to take care of GC and other things.
Haxe ships with its own package manager called haxelib.
Haxe was developed by Nicolas Cannasse and other contributors and is backed by the Haxe Foundation. It was named Haxe because it was short, simple, and "has an X inside", which the author humorously asserts is necessary to make any new technology a success. Haxe is pronounced "hex" /heks/
, although many community members pronounce it "hacks".
Haxe is known for its multitude of game development and multimedia libraries. With frameworks like nme, openfl or kha built on top of Haxe, developers can target platforms like:
All from a single code base.
Popular game engines include haxeflixel, haxepunk, flambe and luxe. The powerful nape physics engine is written in Haxe as well.
With UI frameworks like haxeui and stablexui, user interfaces can be created for a wide range of target platforms. With ufront, there is also a feature-rich MVC web framework available. To create reactive web applications using a virtual DOM, coconut.ui can be used, which shares significant similarities with react.