5 ms·
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 bet
by uvtc 8y ago
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?
- lasagnaphil 8y agoI 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 https://hashlink.haxe.org
- isr 8y ago> On the other had Nim only transpiles to C Nim also compiles to javascript too, right?
- dom96 8y agoYep. C/C++/obj c and JS
- uvtc 8y ago> 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!