Earlier quoted context omitted.
Making use of the same bits of code on both the client and server (or whatever platforms you need to support). So if you have, let's say, some code that formats relative dates, Haxe allows you to write that code in one language and reuse it on both the server- and client-side, whereas normally you'd have to write a separate version of that in Python and in AS3.
Thanks. Is this really a big issue though? How often do you really need shared code between the server and client? Seems like I'm missing something.
A success story for Haxe
31–40 of 67 posts
Re: A success story for Haxe
#32Earlier quoted context omitted.
Making use of the same bits of code on both the client and server (or whatever platforms you need to support). So if you have, let's say, some code that formats relative dates, Haxe allows you to write that code in one language and reuse it on both the server- and client-side, whereas normally you'd have to write a separate version of that in Python and in AS3.
Thanks. Is this really a big issue though? How often do you really need shared code between the server and client? Seems like I'm missing something.
Re: A success story for Haxe
#33If you have a critical bone in your body, prepare for a love/hate relationship. It is so good and yet so bad in various ways. I wrote a few unpublished games with 2.0 and NME back when (e.g. mzzl).
Re: A success story for Haxe
#34 class Test {
static function main() {
var people = [
"Elizabeth" => "Programming",
"Joel" => "Design"
];
for (name in people.keys()) {
var job = people[name];
trace('$name does $job for a living!');
}
}
}Re: A success story for Haxe
#35The sample program on the Haxe main page demonstrates a complete misunderstanding of the value of dictionaries. Not exactly inspiring one to learn more. class Test { static function main() { var people = [ "Elizabeth" => "Programming", "Joel" => "Design" ]; for (name in people.keys()) { var job = people[name]; trace('$name does $job for a living!'); } } }
The "people" instance is using anonymous syntax for a Map type. Haxe's Map types are actually abstract types: http://haxe.org/manual/types-abstract.html. I doubt many developers are familiar with this type of feature.
For instance, here's a "packed array" implementation that lets me store an array of integers in a fraction of the space usually needed for a standard array type: https://github.com/jdonaldson/packhx Abstract types let me use the same api that standard arrays use (including array accessors), even if the underlying runtime implementation is completely different.
The other nice things going on in the example is the simple for loop using an iterator, and the nice string interpolation. Granted, this is nothing super sophisticated, but it's great to have these same features across all the targets that Haxe supports.
Re: A success story for Haxe
#36Earlier quoted context omitted.
I've been using haxe/openfl in production for 1.5 years and wouldn't really recommend it. Originally cross-platform code was a really good idea very few people had or executed well and haxe's warts were forgivable, today that's a capability many languages have without the hassle. I think the only unique value left in Haxe is outputting Flash.
what languages have a platform comparable to OpenFL?
Re: A success story for Haxe
#37We just released our second game in Haxe on iOS a few weeks ago and we're releasing the Android version in another 6 weeks. It's a Unity client with haxe-generated C# code and then javascript and node on the server. There have definitely been a bunch of hiccups and hitches along the way, but it's been pretty good overall. https://itunes.apple.com/us/app/world-zombination/id68062469...
Great looking game and near perfection on gameplay, idea, brand, art, assets, ui, icon etc. Flawless victory.
Re: A success story for Haxe
#38Re: A success story for Haxe
#39Earlier quoted context omitted.
I think the value of Haxe comes from being able to use one language across platforms, not anything specific to the language itself. Could you speak to the specific "warts" you found while using it? I'm genuinely curious.
My favorite is Array.sort. Since it's consistent with many other languages you won't get to the docs until your app is crashing. Instead of being fixed it's had a recommended alternative buried in the docs for I think years: The sort operation is not guaranteed to be stable, which means that the order of equal elements may not be retained. For a stable Array sorting algorithm, haxe.ds.ArraySort.sort() can be used ins…
Re: A success story for Haxe
#40I'm looking into potentially using Haxe as a way to share code between iOS and Android. Unfortunately, it doesn't seem like anybody has made a good, open source Objective-C/Swift target for it yet. (There is a Swift target here[0] but it hasn't been committed to since October 8 and doesn't seem production-ready by any means.) I would contribute one myself but I have no experience with OCaml, and don't currently have…
Regarding targeting the web, you can't do this directly with RoboVM, but you can use GWT to do so. This means that you can target Android, iOS, and web with Java. You would have shared code that all platforms could use, and then build the UIs natively. This is pretty much the approach that Google use with Inbox, except they used j2objc instead of RoboVM.