Haxe has been evolving from the beginning. At first there was only JS/Flash8/Neko platforms support, and it now support Flash9, PHP, and C++ platforms (the later enabling to target all the new devices such as iPhone, Android, and much more such as Palm)
Macros in Haxe are a way for developers to enhance and customize the capabilities of the Haxe language. Because Haxe Macros allow you to run some code at compile-time that will generate a Haxe program, the possibilities are unlimited.
Let's quote a few possible usages :
- store the compilation Date into your generated code/binary
- include in your generated code/binary any data that is stored into external files
- perform compile-time encryption
- check SQL, XML, or any other syntaxes at compile-time (with precise error display)
- implement DSLs that will get compiled natively
- rebind the semantics of the language in order to implement new features such as "With" statement, Monads, etc.
- .... and much more !
One of the nice things with Haxe Macros is that they do NOT modify the syntax of the language. The Haxe code continue to be perfectly readable for any Haxe (or Java/JS/C++/AS3/etc.) developer.
Want to learn more about it ? Check Macros documentation
PS : using macros require the latest Haxe SVN, check this page for build instructions.