I did a lot of changes and improvements to Haxe this Week End.
The typer was greatly improved. I fixed some minor issues and I added some lazy type checking so for example when a method is used for the first time, its body is first inferred before we start unifying the arguments. This is really more powerful since you don't have to type arguments and return types of your methods so much, they'll still be strictly type checked. In previous cases for example unification was done even if the method was not yet type checked, and later the unified arguments types where used to type check the method body. That was more error-prone since correct methods could fail because of previous erroneous usage. This is now fixed.
Also, a lot of changes have been made in order to ease Haxe usage. The upcoming beta 1 release is focused on maximizing easability. For example, Haxe will come with a small Neko Web Server that can be run locally to develop websites, so you don't have to install and configure Apache (you might still need to install MySQL if you don't have an accessible database).
Also, on Windows, a small executable called
haxesetup will be part of the distribution. It will setup the
PATH environment variable correctly and register the
.hxml files to be run with the haxe commandline compiler.
The HXML format is just a list of Haxe parameters in a text file (one parameter or class name with optional argument per line). Here's an HXML example :
-neko test.n -main TestServer.hx --next -swf test.swf -main TestClient.swf
Running the HXML is the equivalent of calling the following command :
haxe -prompt -neko test.n -main TestServer.hx --next -swf \ test.swf -main TestClient.swf
The user simply doubleclick on the HXML file to run it. If an error occurs and
-prompt was set, then the Haxe compiler will wait for Enter before exiting. This way the errors are displayed in the newly opened Windows Console. In that example, it will compile the server and the client (
--next separates two Haxe batches, like if Haxe was called two times).
So what ? You could think that it looks like a poor Makefile system. True. It's nothing fancy, but it's just a good and easy way to enable Windows users to use Haxe without opening an IDE or the commandline, and it doesn't prevent using the Haxe compiler directly from the commandline.