News for hackers. Stuff that matters.
Re:Why I Use Nim instead of Python for Data Processing by nine_k on Saturday September 25, 2021 @05:17AM (#28651704)
Why do we use Python for data processing?

Because we use it as a nice syntactic frontend to numpy, a large and highly optimized library written in C++ and Fortran (sic). That is, we actually don't use "Python-native" code much, and numpy is essentially APL-like array-oriented thing where e.g. you don't normally need loops.

For native-language data processing, Python is slow; Nim or Julia would easily outperform it, while being comparably ergonomic.

Re:Why I Use Nim instead of Python for Data Processing by stutonk on Saturday September 25, 2021 @11:48AM (#28654017)
Apparently there's also a data processing library for Nim called Arraymancer[0] that's inspired by Numpy and PyTorch. It claims to be faster than both.

[0] https://mratsim.github.io/Arraymancer/

Re:Why I Use Nim instead of Python for Data Processing by teleforce on Saturday September 25, 2021 @12:21PM (#28654302)
Please add D language to the mix as well. Interestingly, you can simply replace Nim with D in the blog article and most of the contents will still make sense!

The funny thing is that Nim and Julia libraries are still wrapping Fortran numerical library while D has beaten the old and trusted Fortran library in its home turf five years back:

http://blog.mir.dlang.io/glas/benchmark/openblas/2016/09/23/...

Re:Why I Use Nim instead of Python for Data Processing by dTal on Saturday September 25, 2021 @12:37PM (#28654426)
>Julia libraries are still wrapping Fortran numerical library

You say that, but Julia is rapidly acquiring native numerical libraries that outperform OpenBLAS:

https://discourse.julialang.org/t/realistically-how-close-is...

Re:Why I Use Nim instead of Python for Data Processing by elcritch on Saturday September 25, 2021 @01:27PM (#28654752)
There’s been a tremendous amount of work optimizing blas _and_ ensuring it’s numerically stable. Julia made a good choice to use blas first. Though it’s good to see new native implementations.

For Nim, there’s also NimTorch which is interesting in that it builds on Nim’s C++ target to generate native PyTorch code. Even Python is technically a second class citizen for the C++ code. Most ML libraries are C++ all the way down.

https://github.com/sinkingsugar/nimtorch

Re:Why I Use Nim instead of Python for Data Processing by ChrisRackauckas on Saturday September 25, 2021 @06:28PM (#28656711)
Not necessarily true with Julia. Many libraries like DifferentialEquations.jl are Julia all of the way down because the pure Julia BLAS tools outperform OpenBLAS and MKL in certain areas. For example see:

https://github.com/YingboMa/RecursiveFactorization.jl/pull/2...

So a stiff ODE solve is pure Julia, LU-factorizations and all. This is what allows it to outperform the common C and Fortran libraries very consistently. See https://benchmarks.sciml.ai/html/MultiLanguage/wrapper_packa... and https://benchmarks.sciml.ai/html/Bio/BCR.html

Re:Why I Use Nim instead of Python for Data Processing by leephillips on Saturday September 25, 2021 @12:35PM (#28654411)
Julia is in the process of replacing many C and Fortran numerical libraries with pure Julia implementations, because they have similar performance.