News for hackers. Stuff that matters.
Re:Nim (formerly Nimrod) 0.10.2 released by pcwalton on Monday December 29, 2014 @10:43AM (#8810195)
That isn't an advantage, IMHO. rustc generates LLVM IR, which allows it to take advantage of essentially all the same optimization passes that clang does. Generating LLVM IR instead of C has some advantages—debug information can be made more precise, precise aliasing metadata for optimization can be added to the output, accurate garbage collection is possible, there's no need to go through the C parser and semantic analyzer, etc.

Examples of features that rustc uses today for optimization beyond those available in C are the "nonnull" and "dereferenceable" attributes (along with some custom optimization passes to make non-null pointer optimizations stronger than what LLVM provides out of the box). An example of a feature beyond C that it could use, but does not today, is custom type-based alias analysis.

Re:Nim (formerly Nimrod) 0.10.2 released by def- on Monday December 29, 2014 @01:39PM (#8811088)
I'm currently working with the Xeon Phi and there you basically have to use Intel's C, C++ or Fortran compiler if you want good performance out of the box. Since Nim compiles to C I can write code that gets auto-vectorized and -optimized by the Intel compiler.
Re:Nim (formerly Nimrod) 0.10.2 released by dom96 on Monday December 29, 2014 @10:53AM (#8810234)
Perhaps it's not an advantage, but it certainly is not a disadvantage. An advantage that I can think of is portability as well as easier interfacing with C libraries.
Re:Nim (formerly Nimrod) 0.10.2 released by pcwalton on Monday December 29, 2014 @10:59AM (#8810259)
Almost all systems that matter have an LLVM port these days, so portability isn't really an issue in practice (though sometimes C can help with microcontrollers, etc.) Game consoles in particular are all x86 or PPC these days. Easier interfacing with C libraries is a fair point, although you still have to figure out how the two languages' type systems interact and presenting good error messages can be a pain if you're relying on the C compiler to do semantic analysis.
Re:Nim (formerly Nimrod) 0.10.2 released by eonil on Monday December 29, 2014 @01:22PM (#8811005)
I disagree to optimisation, but agree to portability. It's difference of 100% and 99%, but sometimes the 1% can be significant. And of course, it also can be insignificant.