r/programming • u/sportifynews • May 14 '21
Python programming: We want to make the language twice as fast, says its creator
https://www.tectalk.co/python-programming-we-want-to-make-the-language-twice-as-fast-says-its-creator/
780
Upvotes
9
u/latkde May 15 '21
The issue with C interop is that Python has to stick with the PyObject data structure. This can have far-reaching consequences. If ownership of a Python object is shared between optimizable Python code and a native module, this effectively means the Python code must also interact with PyObject and can't really be optimized.
This doesn't have to be an insurmountable problem though:
Could only optimize code where an escape analysis indicates that it's safe to do. This will do wonders on more mathy or more algorithmic code, but will be disappointing in many real-world scenarios.
Break compatibility and completely redo the C data model. However, this would be a regression to the early 2.x series. One of the big features of 2.6 and 3.x was that all values can be treated as normal objects.