I can understand e.g. people use CoffeeScript because JavaScript is more verbose. But why target Python from Haxe? Shouldn't it be the other way around?
I can understand e.g. people use CoffeeScript because JavaScript is more verbose. But why target Python from Haxe? Shouldn't it be the other way around?
It does seem slightly odd (many would prefer Python for the language, not the platform), but for those of us more familiar with Haxe, or with existing code/projects in Haxe, being able to target Python means having access to a wider array of libraries, which I guess is kind of cool.
You can however use any expression you want in them, and have macros read them and confirm they are correct, and do whatever you want with them. For example I do some validation on my models:
@:validate( _.length>0 && _.indexOf(' ')==-1 )
public var username:String;
As for the bigger question - they are limited in what they can add, but they have many features not in other languages, they just implement them in a syntax-heavy way on the languages that lack such features. Pattern matching is a good example [2].See http://haxe.org/documentation/introduction/language-features...
[1]: http://haxe.org/manual/lf-metadata.html [2]: http://haxe.org/manual/lf-pattern-matching.html