Downloading Haxe 4.2.0

If your download does not begin automatically please click here.

Support the Haxe Foundation

Thank you for downloading Haxe. If you'd like to support the Haxe Foundation please consider donating to keep our open source efforts thriving.

Monthly Donation Amount

Get Technical Help

Get support directly from the Haxe team. The Haxe Foundation offers several support tiers to help with your organization's technical challenges.

Explore our support plans

What next?

Release Notes

Dear Community,

On behalf of the Haxe Foundation, we are proud to announce the official release of Haxe 4.2.0!

Here are the most notable features made into this release:

  • Module-level fields (see blog post)
  • "Classic" abstract classes and functions (see haxe-evolution proposal)
  • Rest arguments (variadic functions) for all targets (see the doc for haxe.Rest)
  • many other features (see changelog)

Haxe 4.2.0 also includes dozens of other additions, optimizations, improvements, and bugfixes.

Check out the changelog below for more information.

If you have any suggestions or run into any problems, absolutely open an issue on GitHub.

Thanks to everyone involved!

Change Log

2021-02-09 4.2.0:

New features:

  • all : implemented "classic" abstract classes and functions (see haxe-evolution#69) (#9716)
  • all : module-level static declarations (#8460)
  • all : implemented rest arguments (variadic functions) for all targets with haxe.Rest type (#9961)
  • all : per-thread event loops sys.thread.Thread.events (#9868)
  • all : added @:inheritDoc meta to inherit documentation for a type or field from another type or field (#9817)
  • all : support method overloading for extern methods on all targets (#9793)
  • all : constructors forwarding for abstracts with @:forward.new (#9735)
  • all : added EIs constructor to haxe.macro.Expr (#9689)
  • all : added variance forwarding with @:forward.variance (#9741)
  • all : treat Any as Dynamic in variance unification (#6649)
  • all : added some common exception types to haxe.exceptions package
  • all : support metadata in var declaration syntax (#9618)
  • all : added StringTools.unsafeCharAt (#9467)
  • eval : added libuv bindings under eval.luv package (#9903)
  • eval : added bindings to native Int64 and UInt64 implementations under eval.integers package (#9903)
  • cs : UDP socket implementation (#8498)
  • cs : added cs.Syntax module (#10051)
  • jvm : added -D jvm.dynamic-level to control the amount of dynamic support code being generated. 0 = none, 1 = field read/write optimization (default), 2 = compile-time method closures
  • java,jvm : support --java-lib <directory> (#9551)
  • python : threading API implementation (#9754)

General improvements:

  • all : expr is SomeType doesn't require parentheses anymore (#9672)
  • all : increased priority of @:using extensions (#9681)
  • all : allowed usage of static extensions with super (#10062)
  • all : allow @:noDoc on fields too (#9893)
  • all : made Map abstract transitive (#9877)
  • all : support @:native on enum constructors (#9806)
  • all : support @:using on typedefs (#9749)
  • all : changed multiline errors format to use "..." as a prefix for subsequent lines (#9651)
  • all : improved type inference with constrained monomorphs (#9549)
  • all : print no-argument function types as ()->... instead of Void->... (#8148)
  • all : allow function as package name
  • all : improved object inlining (#9599)
  • display : narrow range for hover on parametrized types (#8073)
  • cs : added .NET 5.0 support (#10043)
  • cpp : support native constructors on extern classes (#9516) php: php.Syntax.customArrayDecl (#9113)
  • php : added externs for various php functions and classes
  • php : optimized anonymous objects instantiation (#7916)
  • hl : skip compilation if no module has been changed (#9922)
  • lua : use hx-lua-simdjson for Lua json parsing (#9885)
  • jvm : less CPU consuming sys.thread.Lock implementation

Bugfixes:

  • all : fixed Template.resolve when current context is not an object (#9372)
  • all : get and set functions of haxe.io.Float64Array actually use 64-bit floats now (#9972)
  • all : treat empty blocks {} as object declarations in array comprehension (fixes #9971)
  • all : haxe.format.JsonParser: preserve Float-typed values when they are written as such in JSON (ie. "5.0" or "0.0") (#9844)
  • all : fixed priority of forwarded static extensions (#9680)
  • all : fixed some inconsistency in variance unification for abstracts (#9743)
  • display : fixed completion with platform-specific files (#9423)
  • cpp : fixed conversion of cpp.Int64 to/from haxe.Int64 (#10101)
  • cpp : fixed extending extern classes with @:nativeGen classes (#9431)
  • php : fixed generation with subdirectories in -D php-front=subdir/index.php (#10037)
  • php : fixed local vars with the same names as super global vars (#9924)
  • eval : allow full range of 32bit integers in Std.random (#9974)
  • js : fixed haxe.CallStack.exceptionStack (#9968)
  • js : fixed compatibility issue with closure compiler upon unused catch vars (#9617)
  • lua : fixed anonymous object printing issue with null fields on tables
  • hl : drop data of terminated threads (#9875)
  • macro : fixed haxe.macro.Context.storeTypedExpr for enum constructs (#9828)
  • macro : emit a deprecation warning upon a macro call instead of upon a macro function declaration (#9425)
  • macro : fixed uncatchable error from haxe.macro.Context.getType (#9449)
  • jvm : fixed Type.resolveEnum for enums in the root package (#9809)
  • jvm : fixed Type.resolveEnumName for enums in the root package (#9759)
  • cs : fixed cs.Lib.rethrow (#9738)
  • nullsafety : respect @:nullSafety(Off) on var declarations: var @:nullSafety(Off) v
  • nullsafety : respect @:nullSafety(Off) in closures in constructors (#9643)
  • nullsafety : fixed error "Type not found : haxe.macro._Compiler.NullSafetyModeImpl" (#9483)

Getting Started With Haxe

Now that you've downloaded Haxe, you can get started with a specific platform. Click on a logo to learn how to set up the development environment and how to proceed from there:

For getting started with Haxe, take a look at our introduction, read through the Haxe Manual or look at these use cases for Haxe, including tutorials and popular libraries: