4 ms·
What I like about Nim is that you can always get C performance if you just spend a little time. You can always use a profiler you like (I use vTune) to get to t
by treeform 6y ago
What I like about Nim is that you can always get C performance if you just spend a little time. You can always use a profiler you like (I use vTune) to get to the hot loops and fix them.
See my post here: https://forum.nim-lang.org/t/5363#33576 https://forum.nim-lang.org/t/5363#33576
- mhh__ 6y agoIs that not true of almost any other systems language (depends if you count Go as a systems language)?
- beagle3 6y agoNim still Mostly retains its pythonic nature (fun and readable) even when you do whatever’s needed for C/C++ level performance. I think it’s exceptional in that it feels lightweight while delivering great performance, and it has no “glass ceiling” of any sort. Rust and D have no ceiling either; but D feels like a better C++ and Rust feels like a court filing. D is definitely under-appreciated if you prefer C feel to Python feel
- entha_saava 6y ago> Rust feels like a court filing. But HackerNews and Reddit told me that rust is very ergonomic after two weeks and if you do something in other languages that you can't do in rust, you are doing it wrong and it needs to be fixed.
- mhh__ 6y agoI've been paid to work on D so no need to preach to the converted. I'll have a look at Nim too.
- mratsim 6y agoIt depends. On current CPUs the bottlenecks are in order: - IO processing - Memory - CPU In particular, any language that doesn't have any escape hatch to do manual memory management will have troubles to optimize memory bound workloads. In scientific computing, machine learning, deep learning and in image processing, in particular stencil code, 90% of the workloads are memory bound (the CPU-bound being those involving convolutions and matrix multiplications once you get the data at its proper place, and things involving exponentiation or trigonometric functions).
- bjourne 6y agoDoes nim support SIMD intrinsics? Without those you aren't getting "C performance."
- lasagnaphil 6y agoAbsolutely yes, you just need to let the Nim compiler read the C headers for <immintrin.h> or something like that. Here’s a nice SIMD wrapper for Nim: https://github.com/numforge/laser/blob/master/laser/simd.nim https://github.com/numforge/laser/blob/master/laser/simd.nim