r/Python • • Jun 27 '18

Python 3.7.0 released

https://www.python.org/downloads/release/python-370/
1.3k Upvotes

293 comments sorted by

View all comments

Show parent comments

16

u/uFuckingCrumpet Jun 28 '18

I'm sure it depends quite a bit on what field you're in. In Physics & Astronomy, for example, it is VERY common for a person (or group of people) to build some kind of analysis tools in python or a set of wrappers to help interface python with some existing C++ code and then 100% abandon it once it functions. Whatever version of python was most current when it was written is very likely the only version it will ever successfully run on. I can't necessarily speak to CS fields, but in the physical sciences it's pretty typical for people to write lots of code and follow none of the best practices (e.g. commenting code, handling package dependencies, etc).

0

u/[deleted] Jun 28 '18

[deleted]

2

u/uFuckingCrumpet Jun 28 '18

Yeah, a friend of mine works in a Super K group that still rely on a lot of Fortran 77 code. Most of ATLAS/CMS people have been more receptive to switching to Python 3 but even then it's still surprisingly slow and people still drag their feet.

4

u/gdahlm Jun 28 '18

Fortran is pivotal to python in this field, as evidenced by scipy and numpy which use those same LAPACK/BLAS variants that everyone else does. C/Closure/Java all use those library's too or at least have an option to do so to improve performance.

import numpy as np

numpy.config.show()

If it isn't configured to use some BLAS it is going to be slow. It is just too hard to compete with the performance even in C++. A FORTRAN compiler can just make assumptions that most others can, and producing non-relocatable code helps too. If you know C or another language, try to write a LU function that even 10 times slower than MKL or another ATLAS/BLAS offering. It is hard and humbling.

A potential nice side effect for you is of these large python projects being dependent on the language is that you don't have to choose between Fortran and Python, as these large projects have ensured that the python is up today and works extremely well as a glue language.

https://docs.scipy.org/doc/numpy/user/c-info.python-as-glue.html

1

u/uFuckingCrumpet Jun 28 '18

I'm not sure why you're telling me this.

1

u/gdahlm Jun 28 '18

Ah I missed it was a friend of yours who worked there.

→ More replies (0)