
I definitely must *mention* HPy, but yes, too early to *recommend* it for production purposes. As for Cython/CFFI/ctypes, I keep having the intuition that CFFI can (and likely should) replace all uses of ctypes (I've never seen anything else in the stdlib cause as many Python hard crashes as ctypes!), as well as many uses of the API (until HPy's mature) [probably not uses of Cython, which, if understand right, will just change to use HPy fruitfully "under the covers"] -- but I guess I'll have to work on proving that myself:-). *Thanks* for the permission to quote and/or tweak examples of CFFI use you published -- should make it easier for me (they're *neat* examples -- I still wish I had one of how to use CFFI to define a new *type*, but I guess I'll have to work on that!). Thanks, Alex On Thu, Jul 21, 2022 at 3:24 PM Simon Cross <hodgestar@gmail.com> wrote:
On Thu, Jul 21, 2022 at 11:01 AM Phyo Arkar Lwin <phyoakl@hexcode.tech> wrote:
How about HPY : https://github.com/hpyproject/hpy I think it is the best route currently?
HPy is hopefully the future replacement for the C API itself, but it's not something one can use in production *right now* so it's probably not what Alex would want to recommend to readers in this edition. Perhaps it can be recommended in a future edition.
HPy is also a bit orthogonal to Cython and CFFI, in the sense that one day users of these two tools may simply be able to optionally compile to an HPy extension if they wish and otherwise not be particularly affected.
Regards, Simon