Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You lost me at 'public static function main.'


They found me again at

  enum Cell<T> { nil; cons(car : T, cdr : Cell<T>); }
 
  class List {
    public static function mymap<A, B>(f : A -> B, l : Cell<A>) : Cell<B> {
      return switch(l) {
        case nil: nil;
        case cons(x, xs): cons(f(x), mymap(f, xs));
      }
    }
  }
Some of the Java heritage does seem slightly unpleasant, but interesting features like ML-style tagged enums and structural subtyping for record types mean I'm not going to discount the whole thing just yet.


Functions are public by default. You could leave that out.

The main function has to be static and will serve as the entrance point of the program, not the class. So this might just look like too much when in fact this is just a very small code sample.

Did I address some of your concerns, or did I miss the point entirely? Just curious.


I think his comment could be refrased as "This language looks like Java"


Also, IMHO the fact that Haxe looks familiar to people coming from Javascript, ActionScript, or Java is a plus.


Agreed. I'd wager there are substantially more people learning JavaScript these days than PHP, not that PHP looks too foreign, relatively speaking.


Well at least it doesn't look like PHP...


Actually functions are private by default.

"static function main()" seems to work as an entrance point, though, which makes sense somehow...


I'm sorry, you're correct of course! Private is the sane default obviously.


Yeah, and those shoes totally don't match that purse! What an outrage!

Seriously, if you're prepared to throw out the whole language based on what its syntax resembles, your decision-making process might need a bit of work.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: