Aside from the obvious syntax differences (personally I prefer Haxe’s), and the fact that Haxe supports more target platforms and additionally has its own VM, can anyone comment on the main differences between the two languages?
One feature I noticed from the Nim wikipedia page is that Nim supports UFCS (Uniform Function Call Syntax). I remember seeing that in D. The feature seems confusing to me, as it’s not obvious whether you’re calling a method of the object, or some function via UFCS.
Nim and Haxe share many things. To your list I would add:
a powerful macro system
generics
where they differ is :
Nim generic is template based, which gives you more power
Nim has no real working OOP yet, but you can create OOP easily with the macro system
Nim generics support static[T] which is nice
Nim has build in yield in the iterator
Haxe is much mature and reaches version 4. Nim is struggling to reach version 1
Haxe has pattern matching build in. Nim does this with macro and libraries
Haxe has Enum as ADT, Nim has object variants. I like Haxe approach much more.
Nim allows more low-level programming. you can switch off GC, have manual memory management and have different GCs available (ref counted, mark and sweep, boehm, real time).
Haxe has a static analyzer and very good inliner. Nim relies on the backend compiler to do the job until now. When targeting C or C++ Nim code is in general a bit faster than Haxe (less overhead, better memory handling, no Dynamic). On JS I would claim that Haxe is better
Haxe has a much more options for the backend
So its a matter what you are doing. For system level programming I would choose Nim. For UI, client side, cross platform or games I would choose Haxe. Both are nice and I use both.
IMO, Nim seems not production-ready technology, since the compiler is not very well documented. Makes it seem like a project that may halt unexpectedly.
Nim is production ready and pretty much everything AdrianV stated still holds true except Nim is now working towards version 2. Version 2 will utilize ORC by default, their own high performance automatic ownership and borrowing system that will reduce GC latency for a small sacrifice in throughput.
Haxe still compiles faster in most cases, and Nim has yet to finish their incremental compilation support. This makes fast iteration really frustrating on larger projects.