This article is more than 1 year old

The future of Python: Concurrency devoured, Node.js next on menu

Programming language keeps getting fatter amid awkward version 3 split

Analysis The PyBay 2017 conference, held in San Francisco over the weekend, began with a keynote about concurrency.

Though hardly a draw for a general interest audience, the topic – an examination of multithreaded and multiprocess programming techniques – turns out to be central to the future of Python.

Since 2008, the Python community has tried to reconcile incompatibility between Python 2 and newly introduced Python 3.

For years, adoption of Python 3 was slow and some even dared to suggest Python didn't have a future. As late as last year, Zed Shaw, an accomplished developer and author of the popular Learn Python the Hard Way, even ventured to opine, "There is a high probability that Python 3 is such a failure it will kill Python."

Despite these unsubstantiated odds, Shaw – a polarizing figure for some Pythonistas – this year released a version of his book for Python 3.

Python remains one of the most popular programming languages. It ranked first in IEEE Spectrum's top programming languages for 2017, third in Redmonk's June 2017 ranking, and fifth in Tiobe's August index. And it continues to be recommended for those new to writing code.

It might even be argued that Python is resurgent, thanks to its utility for data science and machine learning projects. Now that almost all the popular Python packages have been ported to Python 3, doubts about the language have receded into the background.

But there's a counterpoint. JavaScript is also exceedingly popular, more so than Python by Redmonk's measure. And it has some advantages when dealing with browsers and interfaces. In April, Stanford began testing a version of its introductory programming course taught in JavaScript instead of Java.

Python and JavaScript are widely used in part because they're easier to pick up than Java, C, C++, and C#. Both have active communities that write and maintain a large number of libraries. And neither has a strong corporate affiliation, the way Java has with Oracle, C# has with Microsoft, and Swift has with Apple.

It's too simplistic to say that the two languages are competing with one another, but there's some of that, particularly now that Python is focusing on event-driven programming.

In his keynote, Python core developer, consultant and educator Raymond Hettinger outlined the advantages and disadvantages of threads and processes for implementing concurrency in programs.

Concurrency is important, he said, because it's how the real world operates. Things don't always happen in a predictable sequence.

Code that implements concurrency can handle multiple tasks that complete at different times. It's essential for writing applications that scale and it remains an area of active discussion among Python programmers.

Last December, Python version 3.6 arrived, bringing with it non-provisional support for the asyncio module introduced in Python 3.4. The module provides a mechanism for writing single-threaded concurrent code.

"It's insanely difficult to get large multi-threaded programs correct," Hettinger explained. "For complex systems, async is much easier to get right than threads with locks."

More about

TIP US OFF

Send us news


Other stories you might like