Add section listing alternative approaches
There have been a number of informative discussions over the years (especially the last few years) about the future of the C-API. It would be worth taking advantage those discussions.
We can start by leaving links to those discussions here. Any of them that might warrant a deeper discussion could also get separate issues. (There's already some discussion about HPy.)
I'll start. @zooba wrote down what I think are some important design principles:
https://mail.python.org/archives/list/[email protected]/thread/B2VDVLABM4RQ4ATEJXFZYWEGTBZPUBKW/
I've opened #7 for a deeper discussion.
My notes: Draft: C API design strategy, Python C-API in non-C languages (and projects I asked to chime in)
Here is the high-level HPy API manifesto and the slightly longer explanation of each item:
- https://github.com/hpyproject/hpy/wiki/c-api-next-level-manifesto
- https://github.com/hpyproject/hpy/wiki/c-api-next-level-changes
And the HPy implementation https://github.com/hpyproject/hpy/ as prior art.
HPy can already run kiwisolver, matplotlib, and enough of numpy to run a simple Game of Life. The links are to the respective ports.
@vstinner has also made detailed proposals in the past and written extensively about it:
- (2019) https://pythoncapi.readthedocs.io/
- (2019) https://mail.python.org/archives/list/[email protected]/thread/RNI3UUI6XUPQQNECZT2DPZFMYIJ42KZ2/
- (2019) https://mail.python.org/archives/list/[email protected]/thread/HS7WDUYFTT2MCAHQQM55UHPJLAVNYCWX/
- (2018) https://mail.python.org/archives/list/[email protected]/thread/ENRZNKIFVKK5JUELQRZKGW4WL6FYCBZ3/
- (2018) https://mail.python.org/archives/list/[email protected]/thread/IUFDUHKM2M3HHXBJWVOA2ZJUW2AEMMQI/
- (2018) https://mail.python.org/archives/list/[email protected]/thread/STTM62RG57IZ2EYDTJ7SVW32S45I4FRO/
- (2017) https://vstinner.github.io/new-python-c-api.html
- https://vstinner.github.io/tag/c-api.html (other blog posts from Victor)
(Victor's personal Python notes at https://pythondev.readthedocs.io/ probably also have some related material.)
Here's a discussion I started about having an official cython-like tool:
https://mail.python.org/archives/list/[email protected]/thread/NSREULQDHSJ6SZTOY5YVSNX4U4AYJOI6/
A discussion started by @hodgestar about replacing the C-API with CFFI:
https://mail.python.org/archives/list/[email protected]/thread/ZV3IQWW7XL6MHZAJARHW62WNZDCX3A4M/
@vstinner also publishes a backward-compatibility shim header that relates here:
https://pythoncapi-compat.readthedocs.io/