Live data from Hacker News

HaXe - Code Once. Deploy Everywhere.

haxe.org

1–10 of 62 posts

Re: HaXe - Code Once. Deploy Everywhere.

#2
I became a huge fan of haxe when I was working at chumby industries and was limited by the firmware to working on AVM1/ActionScript 2 projects. haxe allowed me to use a much more modern language with far better features (eg. compile time macros, inline functions) than AS2 allowed even while hitting the same VM.

It is a really fantastic language for many different platforms and I definitely recommend checking it out.

Re: HaXe - Code Once. Deploy Everywhere.

#4

I became a huge fan of haxe when I was working at chumby industries and was limited by the firmware to working on AVM1/ActionScript 2 projects. haxe allowed me to use a much more modern language with far better features (eg. compile time macros, inline functions) than AS2 allowed even while hitting the same VM. It is a really fantastic language for many different platforms and I definitely recommend checking it out.

1. While haxe has macros, they're like ocaml macros not like lisp macros. You can write a function that takes an ast and returns an ast, but because the language isn't homoiconic it feels a lot more like working with dom than like macros in lisp.

2. as2 is a superset of javascript, so it also has inline functions.

3. Having worked in haxe quite a bit, I found that the fancy type system got in the way more than it helped. I can't think of one case where it caught a bug, but I do have memories of spending hours writing typedefs and casting things to Dynamic.

4. You can't really target multiple platforms in practice, because nearly everything you might want to do depends on host-specific features. A multi platform codebase would be riddled with "if (flash) { } else if (c++) { } else if (javascript) { ...".

Re: HaXe - Code Once. Deploy Everywhere.

#6
Ah, "code once. deploy everywhere." Few examples of marketing to engineers spark quite the same level of skepticism as this oft-repeated claim.

Ignoring, for a moment, the complexity of deploying software across multiple platforms, it's important to remember the multiple form-factor problem. The same software doesn't work from a user's standpoint on multiple platforms if the UI isn't correct for that device. The best example I can give is "mobile versions" of sites and apps, clearly targeted at the form factor of a phone, being delivered to a 10" tablet. It's crappy.

Bring in the obvious elephant in the room of the number of times this claim has been made from an engineering standpoint and truly failed to deliver, and I yawn every time HaXe is mentioned.

Re: HaXe - Code Once. Deploy Everywhere.

#8

I became a huge fan of haxe when I was working at chumby industries and was limited by the firmware to working on AVM1/ActionScript 2 projects. haxe allowed me to use a much more modern language with far better features (eg. compile time macros, inline functions) than AS2 allowed even while hitting the same VM. It is a really fantastic language for many different platforms and I definitely recommend checking it out.

1. While haxe has macros, they're like ocaml macros not like lisp macros. You can write a function that takes an ast and returns an ast, but because the language isn't homoiconic it feels a lot more like working with dom than like macros in lisp. 2. as2 is a superset of javascript, so it also has inline functions. 3. Having worked in haxe quite a bit, I found that the fancy type system got in the way more than it hel…

1. True, but whether or not this is good or bad is subjective.

2. It (AS2 & JS) has functions as a first class type that you can define anywhere, but it does not have inline functions in the commonly accepted C/C++ sense of the definition. Actual inline function support as included in haxe can be hugely important on devices with underpowered CPUs since making a function call has significant overhead in ActionScript when you are running on a dinky ARMv5 core. With inline functions there is no function call thus no overhead (at the cost of making the 'compiled' code larger, which is often a perfectly fine tradeoff).

3. I love the type system, so again I guess this is subjective.

4. There is some truth to this but it is easy to encapsulate code that has to be platform aware (generally UI stuff) into libraries and then keep your primary app code platform independent.

Re: HaXe - Code Once. Deploy Everywhere.

#9
We use HaXe at Justin.tv.

It has some very nice points, but "code once, deploy everywhere" is ridiculous. So many of the crucial APIs are platform dependent that there is absolutely no way your HaXe application is going to be portable.

Re: HaXe - Code Once. Deploy Everywhere.

#10
post #9

We use HaXe at Justin.tv. It has some very nice points, but "code once, deploy everywhere" is ridiculous. So many of the crucial APIs are platform dependent that there is absolutely no way your HaXe application is going to be portable.

Agreed - my Haxe games run on iPhone, PC, Mac and Flash from the same code base. It's way less work than it would be rewriting them, but it's certainly not a panacea.

However, the NME project (http://code.google.com/p/nekonme/) is getting pretty good; it emulates the Flash APIs on other platforms. Great for games; probably not usable for the kinds of stuff you do at Justin.tv.

Post reply on HN