News for hackers. Stuff that matters.
Re:Nim 0.19 by uvtc on Thursday September 27, 2018 @01:31PM (#18086744)
Nim appears to be quite similar to Haxe, though Haxe compiles to numerous additional targets. Aside from that, and the syntax, what are the main differences between Nim and Haxe?
Re:Nim 0.19 by lasagnaphil on Thursday September 27, 2018 @08:51PM (#18090164)
I think the one downside of Haxe (which is also is strength) is that it doesn’t only support compiling to C/C++, but to every major language possible (Java, C#, PHP, Javascript), so the language ends up being too complex. You constantly have to think about how the languages features will map to your target language if you care about performance, which can be pretty unintuitive. And the C++ target (hxcpp) is quite heavyweight and takes a lot of time to compile (at least the last time I checked out). Also C interop doesn’t seem that convenient.

On the other had Nim only transpiles to C, so the language is simpler and easier to reason about performance. (And it probably has faster compile times). It is also explicitly designed to interop with C, so you can easily use all those C libraries in the wild...

But I still have some hope on Haxe, because the main developer is working on Hashlink, which can run Haxe code on a virtual machine but can also transpile it to C for production builds... It seems a more simple and “focused” Haxe target that doesn’t have all the warts of hxcpp...

https://hashlink.haxe.org

Re:Nim 0.19 by uvtc on Thursday September 27, 2018 @11:47PM (#18090893)
> I think the one downside of Haxe (which is also is strength) is that it doesn’t only support compiling to C/C++, but to every major language possible (Java, C#, PHP, Javascript), so the language ends up being too complex.

I don't understand --- I would think it's quite the opposite. Implementing too many unique target-language -specific features in Haxe would mean lots more compilation acrobatics to make those features work across every target language, correct?

> the main developer is working on Hashlink, which can run Haxe code on a virtual machine but can also transpile it to C for production builds

Yes, very excited about HashLink!

Re:Nim 0.19 by isr on Thursday September 27, 2018 @08:57PM (#18090182)
> On the other had Nim only transpiles to C

Nim also compiles to javascript too, right?

Re:Nim 0.19 by dom96 on Thursday September 27, 2018 @11:32PM (#18090818)
Yep. C/C++/obj c and JS