Live data from Hacker News

Haxe 4.2

community.haxe.org

71–80 of 105 posts

Re: Haxe 4.2

#71
post #68

Haxe is my favorite programming language. Haxe's macro system is so incredibly powerful that after using it, it makes me cringe every time I have to work with templates in C++. Haxe macros are basically "template meta-programming", but with a lot more power and none of the hideous syntax and error messages. I think the closest parallel in the world of C++ is Circle ( https://www.circle-lang.org/ ). A Haxe macro is ju…

> A Haxe macro is just regular Haxe code with the same syntax and same standard library, except it runs at compile time, and it can operate on the AST of your program. They're like shaders, but for your compiler.

Scala macros are the same way (but with an obtuse API until Scala 3, which should be out soon after all the syntax bikeshedding is done). It's also one of the things I love about Scala, though I'd understand why others might disagree. Metaprogramming is fraught; even moreso when it's plain that it's a program that runs at compile time (which is also the case with C++ templates, to fewer complaints per-capita for reasons I don't understand)

Re: Haxe 4.2

#72

Earlier quoted context omitted.

Ah, so it is[0]. The GP's example doesn't require pattern matching though; as I mentioned, it would work in a language lacking it. 0. https://haxe.org/manual/lf-pattern-matching-structure.html

How so?

[playerA.move, playerB.move] is an array literal value, as are [Rock, Scissors] and the other controlling expressions. The switch simply performs a direct comparison between the two; there need be no destructuring for that to work.

Re: Haxe 4.2

#73

Earlier quoted context omitted.

How so?

[playerA.move, playerB.move] is an array literal value, as are [Rock, Scissors] and the other controlling expressions. The switch simply performs a direct comparison between the two; there need be no destructuring for that to work.

I meant 'how would it work in a language without pattern matching?'

Because it seems to me that it won't. E.g. try this in JavaScript right now with a regular switch statement, it doesn't work. You need actual pattern matching.

Re: Haxe 4.2

#74
Anyone know if there's a way to do sound synthesis on the Haxe platform? Obviously there's a way to do sample playback, and at least some the underlying platforms have ways to do it (web audio, core audio, whatever Flash got version 10), but it's never been clear to me when I check it out if there's an abstraction that can target multiple platforms.

Re: Haxe 4.2

#75

Anyone know if there's a way to do sound synthesis on the Haxe platform? Obviously there's a way to do sample playback, and at least some the underlying platforms have ways to do it (web audio, core audio, whatever Flash got version 10), but it's never been clear to me when I check it out if there's an abstraction that can target multiple platforms.

I have a WebAudio implementation for the C++ target (so you can have single API for web and native builds), although it’s planned to be open sourced, it’s currently private but if this sounds useful I’m happy to try to get you a copy before then

Re: Haxe 4.2

#76
I work for a company for a company where we are heavily invested in Haxe and have built our platform in it, which we use to create applications. Doing this allows us to target HTML/JS and Unity3D with the same code base for an application. I'm hoping we might eventually release the platform under some kind of open source license, when it matures a bit more.

However at the moment we are struggling a bit to find talented programmers, so if anyone is reading this - knows Haxe well, and wants to work in Copenhagen with a company whose mission is "helping to save more lives" (we take that very seriously and hold that above simply making money) then send me a message ;)

Re: Haxe 4.2

#77

Earlier quoted context omitted.

[playerA.move, playerB.move] is an array literal value, as are [Rock, Scissors] and the other controlling expressions. The switch simply performs a direct comparison between the two; there need be no destructuring for that to work.

I meant 'how would it work in a language without pattern matching?' Because it seems to me that it won't. E.g. try this in JavaScript right now with a regular switch statement, it doesn't work. You need actual pattern matching.

'It doesn't work in one particular language that happens to lack pattern matching, therefore it cannot work without pattern matching.'

In particular, pattern matching generally entails destructuring, which you do not need in order to make that particular example work.

Re: Haxe 4.2

#78

How does this compare to Flutter and Kivy? How is debugging and performance?

Flutter is framework, Haxe is language. There is different Haxe frameworks, but debugging/performance mostly depends on target you choose, and Haxe compiler is pretty good on byte/code generation.

Re: Haxe 4.2

#79
post #60

Earlier quoted context omitted.

You mention only good things about Haxe. Why would you expect it to be gone by now?

I guess just because it seemed fairly niche, seemingly targeted mainly towards people making 2D games for cross platform use, around the same time things like Unity & UE became the hot new thing to be using for that type of game dev. People also seemed to look down on it's AS3 like syntax and there was a limited pool of people willing to commit large numbers of hours to working on it as part of their career path when…

This is a great retrospective, thanks

Re: Haxe 4.2

#80

Earlier quoted context omitted.

[playerA.move, playerB.move] is an array literal value, as are [Rock, Scissors] and the other controlling expressions. The switch simply performs a direct comparison between the two; there need be no destructuring for that to work.

I meant 'how would it work in a language without pattern matching?' Because it seems to me that it won't. E.g. try this in JavaScript right now with a regular switch statement, it doesn't work. You need actual pattern matching.

it works in ruby without pattern matching, thanks to ruby's switch statement design where `switch a: case b` invokes `b.match(a)`
Post reply on HN