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 < 5): 300;
case { species: "dog", breed: "golden-retriever" }: 1000;
default: -1;
}
- 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