Python 3 can revive Python

I read this post by a certain Stephen A. Goss about how “Python3 is killing Python”.

It has some compelling arguments, and while I don’t necessarily agree that Python 3 is indeed killing Python, the whole situation doesn’t do Python much good either.

But maybe every crisis is an opportunity, as the cheesy motto says.

Maybe Python 3 can help revive Python.

You see, it’s not just the Python 2 to Python 3 migration that’s troubling. We’re not in 2005 anymore, and newer programmers are not that impressed with either version of Python. Sure, there are lots of Python jobs, but then again, there are even more Java jobs. And once upon a time there were many Perl jobs — I hear they’re not doing that well nowadays. I’m not talking about job count or GitHub repos. I’m talking about mindshare and enthusiasm, and I know that these are a little subjective, but I feel like Python has been lacking in these two regards as of late.

For example we see people going from Python to Go.

Again, they’re not many, but they are quite vocal (including whole startup dev teams blogging about switching their codebase), and enough to create a certain buzz (and to surprise Rob Pike, who initially expected people to come to Go from C/C++).

Python faces competition from all sides. There’s competition that eats Python’s lunch in certain areas (e.g. new async projects seem to prefer Node or Go instead of Twisted, and Rails still dominates the web framework landscape), competition of wannabe contenters in specific niches (like Julia for scientific computing), and general competition (Clojure, Groovy, Javascript, Dart, etc).

So here’s my idea about Python 3. It’s a simple idea:

Make it compelling.

It’s already incompatible with Python 2. And it’s not like people are migrating to it in droves, so adding a few more incompatible changes might not only not hurt, but even benefit the language.

Seriously — if Python 3 had enough enticing new features, more people would migrate to it (at least for new projects), and more people would be inclined to port their Python 2 libs/projects. And, methinks, it would also attract more people that aren’t currently using Python.

You see, Python 3 was a ho-hum update.

Sure, it made the language more coherent and fixed some long standing issues and annoyances. But it didn’t provide that much sizzle. Then again, the language landscape back when Python 3 was conceived and its roadmap was set was far more relaxed. Heck, Javascript wasn’t popular back then. YouTube didn’t exist. It was THAT far back.

Nowadays stuff like proper closures, immutability, a good async story, etc, is considered a necessity by discerning hackers.

Without further TL;DR; here are a few things that might make Python 3 an interesting proposition for today’s hacker types. I, for one, know they would rekindle MY interest:

  1. Remove the GIL. Or provide a compelling async story. Guido’s PEP 3156 might, or might not be that. Some primitives like Go’s channels would be nice to have.
  2. Make it speedy. Seriously, if Javascript can be made fast, CPython could be made fast too. Or PyPy could mature enough to replace it (there should be only one). If it takes big bucks or Lars Bak to do it, start a Kickstarter — I’ll contribute. Shame major companies into contributing too. Isn’t Dropbox spending some money on its own LLVM based Python anyway?
  3. Add types. Well, opt-in types. That you can use to speed some code up (a la Cython), or to provide assurances and help type-check (a la Dart). Add type annotations to everything in the standard library.
  4. Shake the standard libraries. Get a team together to go through them and fix long standing annoyances, improve speed and fix bugs. Improve their API, and offer nice simpler interfaces for common stuff (think requests vs urllib) Offer the new improved library alongside the current standard library in a different namespace. Make it easy to switch over (perhaps with some automated tool).
  5. Revamp the REPL. It’s 2014 already. Redo the REPL in a modern way. Add some color. Take notes from IPython. Make it a client/server thing, so IDEs and editors can embed it.

So, Python 3 dev people, take your time. Well, not too much time. Perhaps, 3-4 years. We’ve waited 10 years for ES6, we can wait half of that for you.

It’s not like anyone is using Python 3 anyway, so take some chances. Break things. Release early and often. Engage the community.

You see, Python 3 is not really killing Python. But it might have a chance to save it from what’s actually killing it.

P.S. What do you think? Can you think of additional stuff that could make Python 3 more enticing? What new feature would tickle your fancy?

Show your support

Clapping shows how much you appreciated Nickos Ventouras’s story.