News for hackers. Stuff that matters.
Re:Why physicists still use Fortran (2015) by nine_k on Sunday October 15, 2017 @11:57AM (#15477656)
Some of the Numpy code is coming from 1970s: it uses BLAS that originates from 1979.

https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprogra...

Immense amount of effort was put in performance, correctness, feature set, and numerical stability of such widely used libraries. Replacing the without a very good reason is hardly feasible.

Re:Why physicists still use Fortran (2015) by quadruplebond on Sunday October 15, 2017 @12:03PM (#15477695)
Blas is an interface, All performant blas libraries need to written to specifically take advantage of modern hardware. Things like NetLib exists as reference implementations, they are not high performance.

The point I am trying to make is that Numpy is unlikely to still be using the exact same code that was written in the 1970's unless its performance isn't critical. It is making the same function calls but the actual code will look pretty different.

Re:Why physicists still use Fortran (2015) by pletnes on Sunday October 15, 2017 @01:20PM (#15478040)
Numpy can use optimised BLAS but I believe it ships with an f2c transpiled reference BLAS so it can run (although slower) without Fortran where necessary.
Re:Why physicists still use Fortran (2015) by quadruplebond on Sunday October 15, 2017 @06:47PM (#15479775)
Sure but that will likely be much much slower.
Re:Why physicists still use Fortran (2015) by eesmith on Sunday October 15, 2017 @01:27PM (#15478061)
Some from the 1960s. Quoting numpy/lib/function_base.py:

    We use the algorithm published by Clenshaw [1]_ and referenced by
    Abramowitz and Stegun [2]_, for which the function domain is ...
    .. [1] C. W. Clenshaw, "Chebyshev series for mathematical functions", in
           *National Physical Laboratory Mathematical Tables*, vol. 5, London:
           Her Majesty's Stationery Office, 1962.
    .. [2] M. Abramowitz and I. A. Stegun, *Handbook of Mathematical
           Functions*, 10th printing, New York: Dover, 1964, pp. 379.
           http://www.math.sfu.ca/~cbm/aands/page_379.htm
Quoting numpy/core/src/npymath/npy_math_complex.c.src:

    /* Algorithm 312, CACM vol 10, Oct 1967. */
    if (a >= 0) {
        t = npy_sqrt@c@((a + npy_hypot@c@(a, b)) * 0.5@c@);
        result = npy_cpack@c@(t, b / (2 * t));
    }
Re:Why physicists still use Fortran (2015) by cm2187 on Sunday October 15, 2017 @12:53PM (#15477940)
I needed a .net math library. My IT department insisted on my trying a wrapper around a Fortran library (I believe purely because they had a license already). All the classes and variables names are short hexadecimals strings. None of the interface is idiomatic to .net (the library only has void returning methods which pass error codes as byref arguments instead of using exceptions, requesting a parameter for the length of any array passed as argument instead of reading it from the array), etc...

Basically I refused to touch this thing, using a library which makes the code unreadable is going to be a bug magnet. I would be surprised if I was the only one having this reaction to 1960s coding convention surfacing in modern code.

So selling new licenses should be a good enough reason.

Re:Why physicists still use Fortran (2015) by krallja on Sunday October 15, 2017 @01:50PM (#15478173)
Your .NET wrapper doesn't need to expose the same name or calling convention. That's why you use a wrapper: to abstract away distasteful non-idiomatic decisions in the wrapped API.
Re:Why physicists still use Fortran (2015) by ryl00 on Sunday October 15, 2017 @01:28PM (#15478067)
Sounds like your IT department botched the wrapper. Wouldn't a more successful candidate likely just have used an abstraction layer between the .net conventions you were expecting and whatever the native code was doing?
Re:Why physicists still use Fortran (2015) by cm2187 on Sunday October 15, 2017 @01:34PM (#15478091)
Nope, the library itself is sold that way. See the documentation:

https://www.nag.co.uk/numeric/DT/nagdotnet_dtw02/html/conten...

Re:Why physicists still use Fortran (2015) by ryl00 on Sunday October 15, 2017 @01:47PM (#15478160)
Ah I see, makes more sense. It would be a massive undertaking to abstract that API into something else.