Live data from Hacker News

Try Haxe

try.haxe.org

11–20 of 89 posts

Re: Try Haxe

#11

In the example in that landing page, there appears to be if statements depending on platform, is this something that's often necessary when using Haxe, or only when you want to perform a specific action for that target language?

http://haxe.org/ref/conditionals

Most standard classes and methods (String, Array, Hash, etc), and a lot of third party libraries are completely cross-platform, so you don't need conditional compilation.

Usually you use conditional compilation either for very low-level per-platform operations / optimizations, or to switch, say, between client code and server code, like here for instance:

https://github.com/clemos/try-haxe/blob/master/src/App.hx

Re: Try Haxe

#12
My initial gut reaction to Haxe from the homepage alone, was "Gah, this language is ugly!'. Then I immediately realized that this ugliness was from the fact that the Source example isn't using a monospaced font. It's sort of amazing that, at least for me, using a proportional font just makes things "look wrong", even though everything is syntactically correct.

Re: Try Haxe

#13
post #5

Haxe is a nice language, though I don't like it's verbosity (hey, it's almost like Java!). Maybe I'm too much spoilt with coffeescript, ruby, python and other syntax-sugary languages.

It has very powerful type-inference, which usually makes it far more concise and expressive than Java or AS3...

It may still be a bit more verbose than Coffeescript or Python, but once your code is written you can theorically run it almost anywhere :)

Re: Try Haxe

#14
post #12

My initial gut reaction to Haxe from the homepage alone, was "Gah, this language is ugly!'. Then I immediately realized that this ugliness was from the fact that the Source example isn't using a monospaced font. It's sort of amazing that, at least for me, using a proportional font just makes things "look wrong", even though everything is syntactically correct.

Ok, ok, I switched back to monospace...

Re: Try Haxe

#15
post #5

Haxe is a nice language, though I don't like it's verbosity (hey, it's almost like Java!). Maybe I'm too much spoilt with coffeescript, ruby, python and other syntax-sugary languages.

My question is, how do Haxe and NME relate? I started reading about Haxe, started working with the tool, then found all these references to NME which I'm not clear if it's a subset or a fork or ?

Would like to use this for the game I'm working on since the idea of write once, compile everywhere is seductive. Of course I seem to recall that when Java first came out that was supposed to be it's claim to fame...

Re: Try Haxe

#16
The cross-platform thing is a bold claim. How about a more complete example than that 5 line hello world program to show us how that would work?

Re: Try Haxe

#18
post #16

The cross-platform thing is a bold claim. How about a more complete example than that 5 line hello world program to show us how that would work?

http://try.haxe.org/#655c1

You can compile this example to both Flash and JS online.

If you install Haxe and NME (http://haxenme.org), you can also compile it to iOS, Android, WebOS, BlackBerry, as well as desktop Mac, Windows and Linux binaries.

And these are only the possibilites offered by NME, which is basically a Haxe-based Flash API implementation.

Re: Try Haxe

#19
Haxe sounds too good to be true. Why would anyone use any of the other game engines out there which are targeted towards the mobile world if they could use Haxe? I see many half-donejavascript frameworks and fully-baked lua frameworks...what do they provide that Haxe doesn't? Can anyone who has done significant Haxe work comment to some of the benefits and drawbacks? I ask as someone in search of a gaming engine which can target iOS and Android, so this is very interesting to me.

Thanks.

Re: Try Haxe

#20
post #6
post #5

Haxe is a nice language, though I don't like it's verbosity (hey, it's almost like Java!). Maybe I'm too much spoilt with coffeescript, ruby, python and other syntax-sugary languages.

Hey, it has macros! But it doesn't compile to coffeescript ... yet ... http://haxe.org/manual/macros

What would you do after compiling to coffeescript other than compile to javascript? It's not like you can persist changes that you make to the compiled coffeescript result between compiles.
Post reply on HN