It's very hard to find a problem hitting all of the four criteria
I see this all the time in Python threads, and I've seen it in Raymond Hettinger's talks. This is a post-facto justification.
It's hard to find applications that have these problems in Python because Python unsuitable for them, not because the problems are rare.
The truth is that they exist in nearly every project, but they're usually exported to other systems not written in Python. For lots of web applications, this is the database; for data intensive applications, it's spark + some combo of pandas and numpy.
Problems requiring parallelism are exported to other tools written in other languages because Python supports it poorly. Often this comes at the added cost of serialization (which is CPU bound, generally). Python programmers don't experience this because these systems are not written in Python; of the systems I named, only one has significant Python code (Cython is not Python).
If a Python programmer wants to write this type of program, they will probably have to choose a different language. I can buy the idea that they should do so anyway ("if you aim for CPU speed, why use CPython anyway?"), and maybe that means it's true that CPU parallelism will not significantly change Python's strengths.
What I don't agree with is that these problems are rare; I think they occur in most projects. And to clarify, even if Python got 10x faster + cpu parallelization tomorrow, people would not be ditching these other systems; but what would change is that Python programmers would start writing them, and perhaps more tellingly users of other languages would use them.
It's the denial that this is common that lets people say "If your single threaded program is slow, multi-thread won't help either." with such confidence while also having said "for CPU-bound tasks, Python indeed has a serious problem". It can't be both.
1
u/jmoiron Jul 16 '18
I see this all the time in Python threads, and I've seen it in Raymond Hettinger's talks. This is a post-facto justification.
It's hard to find applications that have these problems in Python because Python unsuitable for them, not because the problems are rare.
The truth is that they exist in nearly every project, but they're usually exported to other systems not written in Python. For lots of web applications, this is the database; for data intensive applications, it's spark + some combo of pandas and numpy.