How to make Python run as fast (or faster) than Julia

Chris Angelico rosuav at gmail.com
Fri Feb 23 13:20:34 EST 2018


On Sat, Feb 24, 2018 at 4:49 AM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> On Sat, 24 Feb 2018 00:03:06 +1100, Chris Angelico wrote:
>
>>> Is numpy a general purpose C library that can also be called from any
>>> language that can use a C API? Or is it specific to Python?
>>>
>>>
>> No, it's a general purpose FORTRAN library that can also be called from
>> any language that can use a generic C, FORTRAN, COBOL, etc API.
>
> Numpy itself is a collection of Python interfaces to a number of C and
> Fortran libraries. You can't generally call numpy from other languages --
> you can't even call numpy from other Python implementations, unless they
> support calling C/Fortran. Jython, for example, can't do it without help:
>
> https://jyni.org/
>
> and while PyPy can call numpy, doing so is slow, and there's a custom
> fork of numpy specially for PyPy:
>
> https://bitbucket.org/pypy/numpy

Right. I was kinda handwaving a bit; numpy itself isn't the thing
you'd call from elsewhere, but BLAS libraries in general are intended
to be available from many languages. Point is, it's not
Python-specific.

ChrisA



More information about the Python-list mailing list