News for hackers. Stuff that matters.
Re:Hello Lua by PeCaN on Friday April 29, 2016 @01:20AM (#11593890)
Haxe is what ActionScript should have been. However (imo), it's hard to find a niche for it now. What does it get me that Perl and OCaml don't? I've been drawn to Haxe several times over the years, but have never really thought of a project, "huh, Haxe would be a great fit here". Maybe if I wrote a mobile game or something.
Re:Hello Lua by jdonaldson on Friday April 29, 2016 @01:59AM (#11593989)
Haxe is really a formidable little virus. It does a lot of small things nicely, but doesn't have a single knock-out feature that you can trot out during language comparisons.

However, all those little features add up over time and become addictive. You start really missing them when you go back to other languages. In the back of your mind you think of how you might solve something simply with abstracts or macros, or how you might easily reduce the file size or execution speed with dead code elimination or inlining.

I would choose Haxe over Perl because of Haxe's expressive type extension capabilities. I could add useful methods to string or array types, and make the resulting code short and sweet (although perhaps less readable for others).

I would choose Haxe over OCaml and I would gain Haxe's superior compiler error messages. I would also get to move seamlessly between functional and imperative programming styles, and still get to use ADTs.

Re:Hello Lua by catnaroek on Friday April 29, 2016 @03:06AM (#11594197)
OCaml accommodates imperative programming just fine: `if` without `else`, `for` loops, single semicolons as statement delimiters (without enclosing statement blocks in parentheses), records and objects containing mutable data, etc. OCaml isn't like SML and Haskell, which <strike>do get in your way when you want to program imperatively</strike> push you a little bit more forcefully towards programming in a functional style.

On the other hand, Haxe lacks features like higher order modules and signature ascription, which give the programmer very fine-grained control over the scope of abstractions. Haxe's abstract types are more like what ML had in the 70's, before MacQueen invented the ML module system.

Re:Hello Lua by jdonaldson on Friday April 29, 2016 @03:25AM (#11594261)
OCaml provides some nice syntactic sugar for imperative programming patterns like "if" statements. But, I wouldn't really call it an imperative language, as it has its roots firmly in ML (which is not such a bad thing after all).

Arguing that ML had a precursor to Haxe abstract types is well within reason, but I'm not so sure they're the same. I'll have to do some more reading.

Re:Hello Lua by daurnimator on Friday April 29, 2016 @01:55AM (#11593977)
The reason we started using it at work was we could target both Javascript and Flash from the one codebase.

However, we finally don't need to support flash anymore... so now there's no reason to not just write in javascript.

Re:Hello Lua by throwaway6845 on Friday April 29, 2016 @04:53AM (#11594496)
I find Javascript is quite a good reason not to write in Javascript, but YMMV...
Re:Hello Lua by sitkack on Friday April 29, 2016 @09:16AM (#11595479)
Haxe is still an excellent hedge. Js doesn't offer the same breadth of deployment targets.
Re:Hello Lua by zem on Friday April 29, 2016 @06:25PM (#11599154)
from what little i've seen of haxe (used it for a few toy projects), it seems a lot more pleasant to program in and to maintain than javascript.