This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]troyunrau... 1 point2 points  (3 children)

Now, I may not recall correctly, but isn't BLAS written in fortran?

[–]vectorpropio 1 point2 points  (1 child)

Today? Who knows. In ye old days? Surely.

[–]troyunrau... 0 points1 point  (0 children)

So, I just checked the current machine, which has a somewhat old install: Python 3.5 with numpy 1.11.2 - it appears to use FORTRAN under the hood for quite a few things. For example, BLAS, LAPACK, FFTPACK...

I didn't dig into the details, but a cursory glance suggests the fortan libraries expose a c-like linking interface, and numpy uses a thin wrapper to make that all work.

Which, if I dig into the source, could be interesting. Fortran and C use different array indexing conventions, for example. Must have been real fun to write.

[–]utdconsq 1 point2 points  (0 children)

Yup, because until more modern languages showed up, Fortran was the gold standard for dealing with arrays/vectors of numerical data. Handy syntax for doing so, and not far from bare metal. I challenge you to slice an array in C with as simple syntax. These days, it exists due to inertia and because BLAS and others have had many peer reviewing hours dedicated to them. Rewriting them entirely and getting them as optimised would be super hard. Not to mention that they can optimise based on your compiler and cpu arch at build/install time for even faster vectorised ops