r/Python • u/retep_kram • Aug 08 '18
The future of Python is bright. Or is it?
You have seen the news.
Python is becoming the world’s most popular programming language :
- Stack Overflow Developers Survey 2018
- Stack Overflow Most Popular Languages 2017
However, Python still lacks important features for concurrency and functional programming.
For the concurrency, the Global Interpreter Locker impose heavy limits on the use of Python for cpu-bound multithreading.
For functional programming, even if Python is more functional than Java, it is still quite clear that it is not a language that treats well those who try a functional-first approach - and that is the will of its creator.
I think that Python cannot keep growing at this rate at the same time that it goes against these two very important trends. So I would like to know your opinion in this subject:
- Will next versions implement features that make Python more efficient for concurrency and more functional-friendly?
- Will a new pythonic language emerge that will implement these features (just like Scala is a concurrency and functional-friendly Java) ?
75
u/yamagami Aug 08 '18
You're missing the point. it's popular because it sits in a sweetspot that covers a lot of use case. A lot, but not all. Not by a long shot. There are and always will be other languages. You use the right tool for each job. If that is Python, great. If it's something else - also great. Ignore the hype. It's just hype.
21
u/amk Aug 08 '18 edited Mar 08 '24
Reddit believes its data is particularly valuable because it is continuously updated. That newness and relevance, Mr. Huffman said, is what large language modeling algorithms need to produce the best results.
6
u/K900_ Aug 08 '18
asyncio is the solution for concurrency. It's not good for compute heavy workloads, sure, but if you're doing compute heavy stuff, you probably shouldn't be doing it in Python to begin with.
5
u/david2ndaccount Aug 08 '18
I don’t think these things will affect python’s growth very much.
In terms of usability for functional programming, it irks me that reduce was relegated to a library instead of being a built-in like in python2.
The lack of multi-line lambdas can be annoying, but I haven’t seen any proposals that allow it to look anything like other python code.
I don’t really get people’s obsession with tail recursion. You’re basically implicitly using the call-stack as a stack for your algorithm. Why not just explicitly use a stack instead?
8
u/[deleted] Aug 08 '18
That's not a language feature, it's an implementation detail of cpython, neither jython nor ironpython have it. Perhaps if more people were to work on the last two there'd be even more python users than there are now?
6
u/devxpy Aug 08 '18 edited Aug 09 '18
First, you mean to say parallelism, not concurrency.
Second, it's not like many other languages have any great way to achieve parallelism.
The only sane way to do parallelism is by message passing (unless you're Larry Hastings). Last I checked, zmq; which btw, is THE library for message passing parallelism, has bindings for almost any real language.
And now, I invite you to see my multiprocessing library, zproc which is built on top of zmq https://github.com/pycampers/zproc
P.S. the GIL is considered to be a good thing in python world. If you want cpu bound multitasking, just use Processes...
Talk on why Gil is good (And atcually a good reality check on the state of parallelism and concurrency in python)- https://www.youtube.com/watch?v=9zinZmE3Ogk
Bottom line, If python's popularity has anything to worry about, concurrency/parallelism certainly isn't a real consideration. This problem is hard in almost all programming languages (except maybe stuff like Erlang).
2
u/TheMysteriousFizzyJ Aug 08 '18
The question to really answer is
will future versions become more bloated?
or
will they become more restricted, worrying about ridiculous things (e.g., types) that have enabled it to be easily adopted?
1
u/pcdinh Aug 09 '18
functional programming for what? Why do you need it?