On Thu, 25 Mar 2021 20:22:55 +0300 Ivan Pozdeev via Python-Dev email@example.com wrote:
On 24.03.2021 19:58, Antoine Pitrou wrote:
On Wed, 24 Mar 2021 19:45:49 +0300 Ivan Pozdeev via Python-Dev firstname.lastname@example.org wrote:
How does C++ fare in binary compatibility? Last time I checked it out (about 10 years ago), there was completely none, every compiler's ABI was a black box without any guarantees whatsoever. For any software that's going to dynamically link and exchange binary types with other independently produced software, that's a deal breaker.
That depends if you use C++ internally or expose C++ bits in the public API. If you only use C++ internally, binary compatibility is presumably less of an issue.
Python produces and accepts its internal types in API calls and allows extension modules to derive from them -- so it cannot "only use C++ internally" if those are going to become C++ types. (And if not, the point of using C++ is unclear.)
You can use C++ without exposing C++ types in the API. For example, C++ templates could improve the maintainability of the generic "stringlib" routines that are currently based on C macros. Another example is using RAII in function bodies to help cleanup owned references.