News for hackers. Stuff that matters.
Re:Road to NumPy 2.0 by fouronnes3 on Wednesday September 13, 2023 @07:49AM (#37495475)
I think that ndarray is the most successful abstraction I've come across. Numerical computing is a domain ripe for terrible code, but multi-indexing, broadcasting, mask arrays, .reshape(), .where(), linspace(), and all that are so well made and useful they are now the standard grammar of data science. Yes you've seen horrible numpy code before, but how much worse would it be if it had been written by the same person in raw C with only malloc and pointer arithmetic?
Re:Road to NumPy 2.0 by ktpsns on Wednesday September 13, 2023 @07:52AM (#37495500)
Just FYI, numpy by no means pioneered this concept. There was Fortran before, as a language built around n-dimensional arrays. And even Fortran was not the first one, as some stack based programming languages (such as APL, IIRC) have similar concepts. Also languages such as R and evventually Matlab (as a kind-of nicer frontend to Fortran libs) pioneered this concept. However, Numpy was the first library bringing this into a general-purpose language as Python is.
Re:Road to NumPy 2.0 by yakubin on Wednesday September 13, 2023 @11:02AM (#37497691)
s/stack/array/
Re:Road to NumPy 2.0 by dekhn on Wednesday September 13, 2023 @11:07AM (#37497769)
Numeric Python, the original numpy, was based mainly on the MATLAB array object. Of course, it was also influenced by FORTRAN and other languages, but ultimately, it was taken from the mental model of MATLAB.
Re:Road to NumPy 2.0 by TheRealKing on Thursday September 14, 2023 @12:23PM (#37511017)
and MATLAB was entirely influenced by Fortran's array-based syntax.
Re:Road to NumPy 2.0 by rajandatta on Wednesday September 13, 2023 @01:32PM (#37499265)
Fortran, Matlab and all array based languages (APL, J, K, Niall, etc) have these constructs at their core. Ndarray may be a great implementation but the ideas have all been there. I've been exploring J recently and the flexibility and compactness is tremendous.
Re:Road to NumPy 2.0 by d0mine on Thursday September 14, 2023 @03:43PM (#37513860)
Fortran was created in the 1950s. APL — 60s.
Re:Road to NumPy 2.0 by jcarrano on Wednesday September 13, 2023 @08:24AM (#37495793)
I remember implementing a sliding overlapping 2d windowing by playing with the strides. I don't know how common is that trick but at the time it felt like magic.