-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to shrink the size of the C API? Or at least, slow down its growth? #53
Comments
I thinking the only way to shrink the API is to take care when adding new functions, and aim to deprecate more than we add. Why is the number of Many of the "public structures" weren't supposed to be part of a public API, they just leaked into |
Many APIs can be implemented in terms of others. For example, For lack of better terms, consider the first category the "sugar" API and the second category the "salt" API. I think the size of the API, in terms of maintenance burden, should only be measured based on the size of the salt API. The sugar API might one day be developed and shipped in a header-only or a separate binary. |
The problem is more structure members which are exposed in the public C API: any change in these members is usually causing a lot of pain. Type names are fine. |
See also issue #62: How can an user access old removed functions? Can a 3rd party project provide them? |
IMO, we should have a better problem description here. Why is the size of the API a problem? Which numbers are most problematic -- number of exported functions? Documentation entries? C definitions? Struct members? |
I proposed a solution to this problem: PEP 743 – Add Py_COMPAT_API_VERSION to the Python C API. It's a way to get a subset of the API and so a smaller API. If someone has other ideas to reduce the API size, I suggest opening an issue in the new https://github.com/capi-workgroup/api-evolution project. I close this issue. |
A side question of issue #52 is: how can we slow down the growth of the C API?
Is there a way to add less functions or even stop adding functions?
Fixing the API requires to add variants of existing functions. Sometimes, the old APIs are deprecated and later removed, but the deprecation is slow: PEP 387 "Backwards Compatibility Policy".
See Statistics of the C API: Functions.
Functions (Python 3.6 => Python 3.12):
Structures (Python 3.6 => Python 3.12):
See also issue #39 "Supporting multiple ABI versions at once".
The text was updated successfully, but these errors were encountered: