hpyproject / hpy

HPy: a better API for Python
https://hpyproject.org
MIT License
1.02k stars 52 forks source link

Potential role of CPython and Python Steering Council #421

Open paugier opened 1 year ago

paugier commented 1 year ago

My last question taken from my note about HPy (see also #419 and #420).

Here, it's about the potential position of CPython and Python Steering Council about HPy. How could they help the project?

If you (HPy developers) could ask for small CPython adaptations to help HPy, what would it be?

Potential role of CPython and Python Steering Council

The Numpy port based on a stable version of HPy will be a clear demonstration that HPy should not be considered only as a long term interesting experiment. HPy could change Python user experience of millions of end-users in few years.

I wrote that the HPy project does not directly depend on the support of CPython core developers and the Python Steering Council. However, some clear messages could be sent to help the projet. Moreover, I guess few decisions about CPython could help HPy.

For example, currently CPython cannot import an universal HPy extension without a dummy Python file. This workaround works but is quite inconvenient, since (i) it is not great to add in a Python package automatically generated Python files (that should not be tracked by version control) and (ii) it is incompatible with tools which produce extensions from a Python file (namely Cython in pure Python mode and Pythran) (#203). It could be reasonable that at least CPython 3.12 would be able to recognize an universal wheel and to know that it needs to load it with the package hpy.universal. I guess that such small CPython adaptations for HPy would require a PEP, but it could be reasonable given the potential positive impact of the project for the Python langage, ecosystem and community.

It seems to me that an explicit support by the CPython project, the Python Steering Council and/or the Python Software Foundation is not mandatory for HPy but could greatly speedup the transition towards a globally better Python ecosystem allowed by HPy.

hodgestar commented 1 year ago

@antocuni and I are hoping to have the opportunity to present at the language summit in April, and we are in contact with a number of CPython core developers, so this is a very good time to suggest ideas.

Specifically regarding support for importing HPy universal extensions, I think we've been asked to just open a PR on CPython and to take it from there.