Partial Haxe port