Live data from Hacker News

Haxe 4.2

community.haxe.org

11–20 of 105 posts

Re: Haxe 4.2

#11
Flash/AS3/FAME/Flex is dead but HaXe is still alive. The power of open source. Too bad it didn't caught on, otherwise those who bet their careers on it got lucky with tech that outlived most of what we had 10 years ago (in that domain).

Re: Haxe 4.2

#12

This looks pretty neat. How does this work, do you code and specify a target output? Curious if there is a link somewhere that shows the output files ... I like learned on the front-page example a multi-state (?) switch statement. What is this called and any other languages support this? switch [playerA.move, playerB.move] { case [Rock, Scissors] | [Paper, Rock] | [Scissors, Paper]: Winner(playerA); ...

I think it's just pattern matching - Rust example:

  let a = "Rock";
  let b = "Paper";
  
  let result = match (a,b) {
      ("Scissors", "Paper") => "A wins",
      ("Paper", "Rock") => "A wins",
      ("Rock", "Scissors") => "A wins",
      ("Paper", "Scissors") => "B wins",
      ("Rock", "Paper") => "B wins",
      ("Scissors", "Rock") => "B wins",
      _ => "Draw"
  };

Re: Haxe 4.2

#13

This looks pretty neat. How does this work, do you code and specify a target output? Curious if there is a link somewhere that shows the output files ... I like learned on the front-page example a multi-state (?) switch statement. What is this called and any other languages support this? switch [playerA.move, playerB.move] { case [Rock, Scissors] | [Paper, Rock] | [Scissors, Paper]: Winner(playerA); ...

That's pattern-matching on a tuple, which is common in languages that support destructuring, like Clojure, Scala, OCaml, and other functional programming languages.

Re: Haxe 4.2

#14

This looks pretty neat. How does this work, do you code and specify a target output? Curious if there is a link somewhere that shows the output files ... I like learned on the front-page example a multi-state (?) switch statement. What is this called and any other languages support this? switch [playerA.move, playerB.move] { case [Rock, Scissors] | [Paper, Rock] | [Scissors, Paper]: Winner(playerA); ...

This is pattern matching. Support for this exists in Haskell, Scala, and now even Ruby and soon Python.

Re: Haxe 4.2

#15

This looks pretty neat. How does this work, do you code and specify a target output? Curious if there is a link somewhere that shows the output files ... I like learned on the front-page example a multi-state (?) switch statement. What is this called and any other languages support this? switch [playerA.move, playerB.move] { case [Rock, Scissors] | [Paper, Rock] | [Scissors, Paper]: Winner(playerA); ...

It's called pattern matching. You see it a lot in functional languages, not so much in others. Haxe mostly borrowed it from ocaml.

> How does this work, do you code and specify a target output?

Indeed. You can specify multiple targets on multiple builds if your code is compatible with all of them (which happens without too much work when working with libs that do the abstraction for you, like openfl or heaps -- and yeah, that's mostly for games).

Re: Haxe 4.2

#16

This looks pretty neat. How does this work, do you code and specify a target output? Curious if there is a link somewhere that shows the output files ... I like learned on the front-page example a multi-state (?) switch statement. What is this called and any other languages support this? switch [playerA.move, playerB.move] { case [Rock, Scissors] | [Paper, Rock] | [Scissors, Paper]: Winner(playerA); ...

It's pattern matching, it's a feature of most functional languages (yes, Haxe is OO, but the language feels veeerrrrry familiar to someone who has used OCaml). Starting to become a more common feature as languages absorb and expose functional-style features (C#, Swift, Kotlin, Rust etc)

Re: Haxe 4.2

#17
post #2

I remember thinking that this was a MUCH better language than AS3 for Flash & Flex development. Now, 10 years later, I'm honestly surprised that it still exists and is being maintained. I'm curious how popular it is at this point? Is there a big benefit over something like Typescript now?

For desktop game development it seems better. I don't know if you can use Typescript for GUI applications without Electron or something equivalent. There are some successful modern games that were developed using haxe[0].

[0] https://haxe.org/use-cases/games/

Re: Haxe 4.2

#18

Does anyone have any real world experiences with Haxe? I've been hearing about it for years and generally thought "wow, that's neat!" but that's been it. Does it actually achieve what it aims for?

It’s been used to make a number of popular games - Dead Cells and Northgard come to mind, and I think there is a decent number more.

Re: Haxe 4.2

#19

Does anyone have any real world experiences with Haxe? I've been hearing about it for years and generally thought "wow, that's neat!" but that's been it. Does it actually achieve what it aims for?

I don't know about your latter question but the devs who made the game Dead Cells used Haxe for it.

Re: Haxe 4.2

#20
post #2

I remember thinking that this was a MUCH better language than AS3 for Flash & Flex development. Now, 10 years later, I'm honestly surprised that it still exists and is being maintained. I'm curious how popular it is at this point? Is there a big benefit over something like Typescript now?

For desktop game development it seems better. I don't know if you can use Typescript for GUI applications without Electron or something equivalent. There are some successful modern games that were developed using haxe[0]. [0] https://haxe.org/use-cases/games/

There are Electron applications written in Haxe too (via the JS target and Node + Electron type definitions), such as these two level editors for games:

- LDtk: https://ldtk.io/

- Ogmo 3: https://ogmo-editor-3.github.io/

Post reply on HN