How about HPY :  https://github.com/hpyproject/hpy  I think it is the best
route currently?

On Thu, Jul 21, 2022 at 6:39 AM Alex Martelli via pypy-dev <
pypy-dev@python.org> wrote:

> Hi Maciej, Armin, et al!
>
> Together with co-authors I've CC'd, I'm getting close to finishing the 4th
> edition of "Python in a Nutshell", and in particular I'm in charge of the
> "extending and embedding" chapter ("chap 24" based on the 3rd Ed's number),
> which in the first three editions focused almost exclusively on Python's C
> API.
>
> Working on the 4th edition I dug deeper into CFFI and I'm getting close to
> being convinced that it's THE way to extend (dunno about embed?) Python --
> CPython as well as of course PyPy -- putting ctypes for sure, the API
> likely, and maybe even Cython in the shade. HOWEVER -- I now face the task
> of subtly convincing people who've been mostly using (especially!) ctypes,
> to switch to CFFI (esp. now that they can easily download free C compilers
> for all platforms, inc. Windows).
>
> Alas, I don't have enough real-life CFFI experience myself (and it's hard
> for me to get any since I'm still working 60%-time for Google, where CLIF
> is THE approved way to extend Python). I wonder if any of you would like to
> take a look and offer suggestions about the chapter, *especially* after
> the way-too-miniscule coverage of CFFI. I need (for evangelism purposes!)
> credible examples, esp. one setting CFFI head-to-head against ctypes (but
> comparisons with cython and the API would be fine too -- IF I could figure
> out how to define completely new Python types in CFFI, which so far escapes
> me).
>
> If asking for your collaboration is too much, is there at least a way to
> get your OK about reusing, with small adaptations, some of the excellent
> examples you give on CFFI's docs? That would probably work better than me
> trying to work things out from scratch, but, without your explicit
> permission, it would likely break copyright or something.
>
> BTW, since we're trying to slim down the page count of the Nutshell, I
> suspect that ch.24 will live mostly online, accessible 100% freely, with
> the paper book devoting just very few pages to summarizing the options for
> extending and embedding and linking to the online materials. I know my
> co-authors (CC'd) are fine with that but I still need an official OK from
> O'Reilly (I think I'll get it). Just in case this makes a difference to
> your attitude about cooperating with us in crafting this chapter!-)
>
> Thanks,
> Alex
>
>
>
> _______________________________________________
> pypy-dev mailing list -- pypy-dev@python.org
> To unsubscribe send an email to pypy-dev-le...@python.org
> https://mail.python.org/mailman3/lists/pypy-dev.python.org/
> Member address: phyo.arkarl...@gmail.com
>
_______________________________________________
pypy-dev mailing list -- pypy-dev@python.org
To unsubscribe send an email to pypy-dev-le...@python.org
https://mail.python.org/mailman3/lists/pypy-dev.python.org/
Member address: arch...@mail-archive.com

Reply via email to