I did a lot of changes and improvements to haXe this WeekEnd.
The typer was greatly improved. I fixed some minor issues and I added some lazy typechecking so for example when a method is used for the first time, its body is first infered 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 typechecked. In previous cases for example unification was done even if the method was not yet typechecked, and later the unified arguments types where used to typecheck the method body. That was more error-prone since correct methods could fail because of previous erronous 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 batchs, 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.