Live data from Hacker News

The Joy of Haxe

medium.com

11–20 of 91 posts

Re: The Joy of Haxe

#11
post #6
post #3

Earlier quoted context omitted.

Well TypeScript also had a huge corporation with infinite budget and a large full time team of contributors and evangelists which probably helped adoption.

Counter-example: Dart. If corporate support is a definite factor, Dart would have taken off way earlier than now. A bigger factor in TypeScript's success would be the ability to gradually migrate the projects as it's a superset of JavaScript. How do you start migrating? Flip the file extensions from .js to .ts with loose compiler options, then gradually add typing as the options are tightened. It's factors like these…

Dart is vastly underrated.

From an external perspective, Google's enthusiasm for Dart seemed half-hearted at best. Its launch was encumbered by rocky political issues, with half the community terrified that they were looking at a new VBScript, and Google's competitors actively stoking said terrors. It could've jeopardized Chrome's ascendance by turning off tech people, on whom any new software depends for propagation, and giving MS/Apple/Mozilla some room to doubt Google's commitment to the extant web, and that was surely enough to make pouring heavy resources into it a non-starter from a business perspective. It's naive to believe that any technical considerations entered into it.

Take a look at Kubernetes if you want to see what happens when Google is committed to using that G-Juice to cram something down the community's throat.

Re: The Joy of Haxe

#12
Like the author, I too have the same opinion after having used Haxe for over 5 years.

  Five years on from starting with Haxe at FontStruct, I’m genuinely surprised to find that I feel no regret whatsoever regarding our decision to go with the technology.
I absolutely adore the language. Not only is it awesome at transpiling/compiling to native across this whole spectrum of targets, the language itself keeps surprising me with how versatile it is; with great type inferencing, compile time macros, platform-conditional compilation, and more.

I've launched iOS, Android, Web, Windows and Mac apps that all shared the same code base. I can't see myself ever wanting to go back to using a single-target language again. I highly recommend trying it if you're on the fence. [0]

Note: I am not affiliated with Haxe, just a huge fan.

[0] https://try.haxe.org/

Re: The Joy of Haxe

#13
post #10
post #7

Earlier quoted context omitted.

Has Dart taken off? I think most people recoiled in horror when they saw the early-days "hello world" turn into millions of lines of generated code.

Not that I'm aware of, no. I don't know, but it seems to me like WebAssembly is more promising for conveniently bringing all programming languages to web applications, rather than languages like Elm or Dart whose standard implementations compile to JavaScript and are designed only to program web applications.

Dart is not designed only to program web apps

you can target mobile with Flutter, and also command-line etc.

Re: The Joy of Haxe

#14
I am glad Haxe is still going strong. I remember when it was an alternate language for the Flash virtual machine- everyone thought it was very cool at the time. Now Flash is dead, long live Haxe!

Re: The Joy of Haxe

#15
post #9

I first learned about Haxe through Lucas Pope’s dev log for “Papers, Please”. Sounded interesting and fun, though Pope (who developed PP on a Mac) said he also had written custom tooling for his work — maybe that situation had changed since 2014: https://www.gamasutra.com/view/news/209905/Road_to_the_IGF_L... For his new game, Return of the Obra Dinn, he went with Unity because of its 3D capability: https://forums.ti…

I wouldn’t be surprised if he does a mix of Haxe and Unity; Haxe compiles to C# too and works very nicely with Unity.

In my current project I ultimately switched off of Unity for 3D due to its less than stellar WebGL support (and I wanted to target web), but with Haxe I simply changed my target to JS and got to reuse most of my code. The ability to switch/add targets at any point of your product’s lifecycle is incredible.

Re: The Joy of Haxe

#16
post #6
post #3

Earlier quoted context omitted.

Well TypeScript also had a huge corporation with infinite budget and a large full time team of contributors and evangelists which probably helped adoption.

Counter-example: Dart. If corporate support is a definite factor, Dart would have taken off way earlier than now. A bigger factor in TypeScript's success would be the ability to gradually migrate the projects as it's a superset of JavaScript. How do you start migrating? Flip the file extensions from .js to .ts with loose compiler options, then gradually add typing as the options are tightened. It's factors like these…

It never felt like Google was really committed to Dart the way that Microsoft is going in on Typescript. My recollection is a little hazy, but I want to think Dart originated in the Flash/Silverlight era, when plugins were still an accepted way to do things, then Chrome flirted with adding native runtime support reminiscent of ancient IE VBScript, then things pivoted to chasing the compile-to-JS trend after CoffeeScript popularized that approach, and now it seems to have pivoted again towards cross-platform native app development. Somewhere in there was also server-side programming as well. I get the sense there was never enough focus on any one thing to achieve critical mass.

Re: The Joy of Haxe

#17
post #13
post #10

Earlier quoted context omitted.

Not that I'm aware of, no. I don't know, but it seems to me like WebAssembly is more promising for conveniently bringing all programming languages to web applications, rather than languages like Elm or Dart whose standard implementations compile to JavaScript and are designed only to program web applications.

Dart is not designed only to program web apps you can target mobile with Flutter, and also command-line etc.

Thank you, I wasn't aware of this.

Re: The Joy of Haxe

#18
post #2

Haxe is strange in that it seems to be very well known among developers but relatively very few actually use it. I guess it's an old project with very specific use cases; like building certain kinds of multi-platform apps. It's nice to see a project with such a dedicated community. It's a shame that most developers started using TypeScript instead of Haxe; that seems like a missed opportunity. TypeScript was pretty p…

I've been using TypeScript professionally for over 2 years now and compared to writing JavaScript it's indispensable but for all my personal work I prefer haxe

-- My love list --

- The generated JavaScript is usually faster and smaller after compile-time optimizations, for example, objects can be inlined so they become stack-only and don't hit the GC. Example: https://try.haxe.org/#0F337

- It's expressive (but familiar); nearly everything is an expression and switch statements support pattern matching:

  var animal = { species: "cat", breed: "bengal", age: 15 };
  
  var friendliness = switch animal {
  	case { species: "cat", breed: "russian-blue" }: 100;
  	case { species: "cat", breed: _, age: age } if (age 
- Fast compile times (for sizable projects you get hundreds of milliseconds rather than seconds – and faster still with incremental builds enabled)

- No need for separate tools like webpack:

> You can perform arbitrary compile-time behavior (like processing and embed assets or generating code) by marking haxe code as a macro

> Generates a single bundle by default

> Dead code elimination built-in

-- The downsides --

- Not many people know about it so it's usually better to stick with TypeScript with clients

- The smaller community means if you might have to be more hands-on, both in learning haxe and when it comes to working with haxe libraries – i.e. fixing a bug upstream rather than waiting for the community to fix it

- The package manager is more bare-bones than npm (personally I _much_ prefer this – I find `npm` and `node_modules` can be a nightmare to work with) but there's a general ask in the community for more advanced package management

Re: The Joy of Haxe

#19
I was talking with some friends a bit ago and was surprised to learn that Haxe is used a lot in game dev and embedded a lot. Apparently a lot of set top boxes like Tivo or car infotainment systems use it, and there's a lot of very good game engine infrastructure in it - https://armory3d.org/ was specifically mentioned as being surprisingly high quality, and all the people that wrote games on Kongregate apparently switched to Haxe.

Re: The Joy of Haxe

#20

Like the author, I too have the same opinion after having used Haxe for over 5 years. Five years on from starting with Haxe at FontStruct, I’m genuinely surprised to find that I feel no regret whatsoever regarding our decision to go with the technology. I absolutely adore the language. Not only is it awesome at transpiling/compiling to native across this whole spectrum of targets, the language itself keeps surprising…

I’ve only had the opposite experience. I worked on a team that inherited a large Haxe codebase for an online education tool, and we found Haxe to be exceedingly bad, even apart fron the nature of the code we inherited. We spent a lot of time porting most of it to a mix of Scala and Javascript. I still remember the daily emotional stress of working in Haxe.

... shudders

Post reply on HN