If your download does not begin automatically please click here.
Thank you for downloading Haxe. If you'd like to support the Haxe Foundation please consider donating to keep our open source efforts thriving.
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 plansDear Community,
On behalf of the Haxe Foundation, we are proud to announce the official release of the Haxe 4.0.0-preview.3! It is available along with the changelog at https://haxe.org/download.
As a preview release, it should not be considered stable. However, we appreciate anyone testing this version which will help us with the real Haxe 4 release. Please report any issues here:
https://github.com/HaxeFoundation/haxe/issues.
Thank you very much for your help!
The most important change of this preview release is the new function type syntax. It was proposed by Dan Korostelev and successfully passed through Haxe Evolution process.
The new syntax provides a natural way for declaring function types with support for argument names which allows to create more readable self-explaining code:
// no arguments () -> Void // single argument (name:String) -> Void // multiple (also, optional) arguments (name:String, ?age:Int) -> Void // unnamed arguments (Int, String) -> Bool // mixed arguments, why not (a:Int, ?String) -> Void
While the old function type syntax is still supported, we would advise using the new one for writing new code.
Since this preview, the final
keyword is allowed in anonymous structure syntax using class notation:
{ /** ordinary field */ var field1:Int; /** Immutable field */ final field2:String; }
This release also makes a few steps towards replacing untyped
code:
There are new js.Syntax.code()
, php.Syntax.code()
and other methods, which should be used for platform specific syntax that is not naturally achievable using Haxe syntax. The Syntax
classe - unlike the untyped
keyword - is type-safe and analyzer-friendly.
The JavaScript target got performance optimizations for its x.iterator()
and Std.is(value, MyClass)
calls. The first one improves iteration over Iterable<T>
, the second one is compiled to plain value instanceof MyClass
instead of a function call where possible.
SSL support was added to HTTP requests for the Python target.
The PHP target does not need to call Reflect.compareMethods()
anymore. Starting from this preview any functions can be compared with the ==
operator, just like it is done for most of the other targets.
Of course, numerous other improvements and bugfixes were implemented. For more details, please refer to the changelog.
See full commit history at https://github.com/HaxeFoundation/haxe/compare/4.0.0-preview.2...4.0.0-preview.3, notable changes below:
New features:
(a:Int, b:String)->Void
) (#6645)-D warn-var-shadowing
General improvements and optimizations:
final
in structures use class notationthis
and super
to toplevel completion (#6051)Reflect.compareMethods()
php.Syntax.code()
instead of deprecated untyped __php__()
(#6708)php.Syntax
for each php operator: ??
, ?:
, **
etc. (#6708)x.iterator()
calls (#6669)value instanceof MyClass
instead of Std.is(value, MyClass)
(#6687)Removals:
php.Syntax.binop()
(#6708)Deprecations:
untyped __php__
, untyped __call__
etc. Use php.Syntax
instead.Bugfixes:
@:to
used when from
is available in a specific case (#6751)tmp
var before invocation (#6672)Sys.environment()
to also return variables set by Sys.putEnv()
sys.net.Socket.bind()
(#6693)sys.db.Sqlite.open()
(#6692)a == b == c
(#6720)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: