Today we're making available for testing the Haxe 2.10 Release Candidate.
At first, 2.09 was supposed to be the last 2.x so we can focus on 3.0, but we got so many nice things that we decided to make a mid-term release, still keeping best compatibility with 2.x, and allowing you also to enable some of the Haxe3 changes by adding a simple
-D haxe3 to your compilation parameters.
Here's a very short list of the main things we got in 2.10 :
- Java and C# targets ! compile with
-csto output Java or C# source code ! Big thanks to Cauê Waneck which is working on this. It's still in beta, should be a lot better for 3.0, but you can already play with it, report bugs and improvements.
- Reduced JS output : we worked a lot so that
--dead-code-eliminationreally eliminates a lot of standard Haxe things from the output. As you can see on http://try.haxe.org/#1cf90, a simple
Hello Haxeexample will be reduced to only 7 lines of JS. We will still activate great features such as reflection, but only when you start using the corresponding API calls (such as Type.getClassName for instance)
- Smarter Type inference : Haxe type inference got several levels smarter. It can now correctly infers the "minimal type" for constructs using multiple values such as constant arrays / switch / etc. , it can auto detects the expected enum in many cases, enabling you to use the constructor without the need to import it, it can now also do subtyping and variance on constant structures and arrays.
- Macros reification : Haxe macros have been available since early 2011, leading to many successful usages. However it is often hard to manipulate AST enums by hand. With the addition of reification, macros just became much more accessible / usable.
- A Haxe/C++ Debugger is on the way ! You should soon be able to debug your code interactively whatever the platform you target.
- Languages improvements : we also made several small language improvements, which together makes Haxe a lot better :
- allow direct initialization of properties and member variables
- sub classes can now widen method visibility
- overriden methods can now be covariant wrt to the original definition
callback(foo,_,0)notation instead of
function(x) return foo(x,0)
- local named functions can now have type parameters and be declared as inline
- type constraints are now supported on function and methods type parameters
- improved @:overload so it can now use type parameters
- and of course, the usual minor improvements, bug fixes, optimizations, etc.
Big thanks to the whole compiler team, and in particular to Simon Krajewski which have been of a great help with the compiler internals since he joined us.
We need your help to test this RC and make sure everything is fine for a proper 2.10 release, which should happen in around two weeks, please report any bugs or regression issues that you might have by posting on the Haxe Group