Why Python hasn't taken off on mobile devices or in the browser
[Copy link]
This post was last edited by dcexpert on 2021-6-10 22:16
Translated from: https://www.zdnet.com/article/python-programming-why-it-hasnt-taken-off-in-the-browser-or-mobile-according-to-its-creator/
Guido van Rossum, creator of the popular Python programming language, gives his thoughts on browsers, mobile devices, and Python competitors like Julia.
Van Rossum, Python's former "benevolent dictator for life," has been working at Microsoft as a distinguished engineer since November, helping the software giant give back to the Python community that helped create one of today's most popular programming languages thanks to the rise of machine learning and data science.
In the past few weeks, he's made a number of announcements to coincide with the PyCon 2021 conference, including plans to double the speed of CPython, the most widely used implementation of the language. Microsoft has funded a small Python team led by van Rossum to work on performance improvements for the interpreted language.
But mobile app development is one of the key growth areas where Python has yet to gain any traction, despite its dominance in machine learning with libraries like NumPy and Google's TensorFlow, and backend service automation. Python isn't exactly limited to high-end hardware, but that's where it's been drawn, he said, and it's been left out of mobile and browsers even though it's popular in the backends of those services.
Why? Python consumes too much memory and power from the hardware, he said. For similar reasons, he said, Python may not have a future in the browser despite WebAssembly, a standard that helps develop more powerful applications on websites.
Developing mobile apps in Python is a "pain point," van Rossum said in a recent Microsoft Reactor video Q&A.
"It would be great if mobile apps could be written in Python. There are actually some people working on that, but CPython is 30 years old and it was built for a workstation, desktop, or server environment, and it expects that environment and users expect that environment,"
he said. "People who have tried to cross-compile CPython to run on an Android tablet or even iOS have found that CPython is very resource-intensive. Python is big and slow compared to what a mobile operating system expects. It requires a large battery, so if you write code in Python, you're likely to drain the battery quickly and run out of memory."
But Python is popular for back-end web services, even though he said JavaScript dominates front-end web development. More and more web developers use Microsoft's superset of JavaScript, TypeScript.
"Python is a very popular language (on the back end). At Google, the projects I work on are basically all based on Python, even though most Google stuff is not. At Dropbox, the entire Dropbox server is built on Python. On the other hand, if you look at what runs in the browser, it's the world of JavaScript, and you can't run it unless it's translated to JavaScript," van Rossum said.
"I don't mind different languages having different goals, I mean no one is asking you when you can write Rust in the browser; at least that doesn't seem like a useful goal for Rust. Python should focus on application areas where it excels, and on the web and scientific data processing as a backend."
Python's benevolent dictator also made a point for Julia, a potential competitor in the scientific computing and machine learning fields (Julia is an increasingly popular language, but it doesn't have the rich machine learning and data science libraries that Python has).
Developers wonder if Julia will remain a niche language or if it has the potential to reach the heights of Python. Van Rossum said that Julia, which graduated from MIT, is an "interesting attempt at something like Python."
"[Julia] has enough details and is very similar to Python that you think of it as inclusion rather than exclusion when you realize, oh, but all the indexes are a range! "
No one is going to try to write code in Julia and Python on the same day," he jokes, calling it a "niche language" compared to Python.
But he adds: "If you're in this area where it's superior because of the way the compiler optimizes your code, Python probably never will be. On the other hand, it's much more limited in other areas, and I don't expect anyone to write a web server in Julia and get much benefit from it." Van Rossum is also a fan of Rust, but he thinks Go, created by Google, is the most "Pythonic" of all the new languages.
|