by gamesbrainiac · 11y ago · 0 comments
EDIT: How has Haxe as a language escaped popular notice for so long?
- Language barrier (Since Haxe docs are first and foremost handled by europeans like me, I know English natives always find it a bit ghetto when they feel the writer isn't a native, but there is very little we can do about it)
- It's not as easy to use as it seems, though OpenFL made it a bit easier.
- Backward compatibility breaks between versions, I'm sorry but a language designer should never do that. I know it's tough to get things right on the first iteration,but v2 libs not working in v3 can slow down a language adoption. We've seen this countless times. It only piss off early adopters.
- Maybe too focused on Flash at first ( But the C++ and JS targets work quite well, in fact, both Android and IOS targets use C++ ).
- written in OCAML... makes it more difficult for people to contribute to the core.
I'd say wait a few more years until the stuff is mature.
EDIT: if you are writing a game it is a no brainer. Your app will run in the browser with JS, Flash and natively on Ios and Android with a single codebase and very very little tweaking.
Aside from that, it has a longer learning curve than TS. This article does a great job of outlining some of the differences.
EDIT: My guess would be that it was originally too focused in its use case as an ActionScript replacement for Flash. In current times, I would say that it has made the same mistake that everything other than TypeScript has: It tries to "fix" JavaScript / ECMAScript. That means learning yet another slightly-different thing, and also porting if it's not a new project. TypeScript has picked up a lot of momentum by taking the superset approach, allowing progressive enhancement of existing codebases. Just start throwing your JavaScript into the TypeScript compiler and you're done.
I should have specified that the above is the reason I would choose TypeScript over Haxe now. There's a lot of times when I will prototype a project in vanilla JavaScript, then set up the TypeScript build infrastructure and start enhancing.
- it didn't easily integrate with existing JS code/libraries
- small community
- low resources (compiler bugs existed and weren't quickly fixed)
The community was a dealbreaker really. Lots of JS libraries already have TS type definitions so it's easy to get started, and TS keeps up-to-date with new JS features.
I prefered the Haxe typesystem, but it didn't really make business sense to keep using it.
They'll probably fix this issue sooner rather than later but in the meanwhile it's a critical issue.
declare var Chart: any;
atop your file, and you can use it the same way you would in JS: without type info. No need to create any type definitions.Or do you mean something different?
Are you talking about what's described here: https://github.com/Microsoft/TypeScript/issues/2242
I just did a small typescript prototype and used the import syntax there. It might have been your typescript version as 1.5 recently came out (and I was using the 1.5 beta 2).
The hardest part is what you described at the start. If it doesn't have a type definition it's hard. DefinitelyTyped helps a lot (https://github.com/DefinitelyTyped/tsd)
I had to create a type definition for something that wasn't there. It was annoying because I had to make the equivalent of a header file before I could use a library.
it doesn't really, you basically need to write definitions files too with Haxe, just like Typescript. Or you loose 'type-safety', just like TS.
TS is off course closer to Javascript.
In the latter case, Typescript gives you some typing for free whereas Haxe doesn't.
And... not having a large company like MS backing it doesn't help it out any.
If anyone browsing the comments section is interested in a familiar-ish, statically typed and fairly powerful language that cross compiles to a huge range of back-ends and platforms, take a couple of minutes to visit haxe.org. It's worth the time.
Simple really - other languages, framework, and SDKs have filled the programming needs of people. I've found most source-to-source compilers to either be completely broken, too complicated to use, or not enough features (I've seen a number of Python to C compilers started and never even close to finished). I discovered Haxe many years ago when I had the idea for my own source-to-source compiler (and created my own lexer, parser, compiler, and virtual machine in C++).
I personally haven't used Haxe yet but I found it's documentation to be pretty good and it seems to have good reviews.
HLA [1] might also be interesting to you.
This has made the language a hard sell in its first decade. Lots of people have passed through, made something amazing, and then wandered off. The compiler has always been solid, but the rest of the ecosystem regularly encounters missing pieces. A "full-stack" mentality is nearly a must to ship a project in Haxe.
But since it's made it this far, it's only likely to keep improving from here. After all, "prevent lock-in" and "reduce portability costs" are powerful selling points.
I wonder if that guy is still at the helm.