yglukhov / nimpy

Nim - Python bridge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for Hpy

Yu-Vitaqua-fer-Chronos opened this issue · comments

Maybe try intergrating Hpy instead of the CPython ABI? Or potentially add a way to choose which one you use? It'd be a good idea to intergrate this because while PyPy (and potentially other implementations) support the CPython ABI to some capacity, it's slow and inefficient, using something like https://github.com/hpyproject/hpy would be beneficial as it wouldn't have to translate the CPython ABI calls as much and would increase compatibility between Python implementations, making Nimpy more versatile

@Mythical-Forest-Collective maybe I'm wrong, but isn't Hpy aimed at making another API for writing native extensions for Python? Because that's only the half of what nimpy does - it also uses CPython API to allow you to call Python code from Nim.

Looks interesting, but I'd wait for it to settle down a bit, official release is still TBD.

@Mythical-Forest-Collective maybe I'm wrong, but isn't Hpy aimed at making another API for writing native extensions for Python? Because that's only the half of what nimpy does - it also uses CPython API to allow you to call Python code from Nim.

I'm mainly talking about making extensions with HPy, as that'd allow Nimpy to work on different interpreters a lot easier and faster (PyPy implements HPy and extensions using HPy are a lot faster), and it is also possible (from what I've read in their docs), to compile HPy extensions for the C Python API. The project isn't completely done yet but slowly adding in support for HPy over CPython's ABI would be beneficial in the long term

Looks interesting, but I'd wait for it to settle down a bit, official release is still TBD.

Yeah fair enough, just thought i should bring it here for possible future reference

Heya, it's approaching the end of 2022 and I'm wondering if you think this would beneficial for Nimpy with HPy's current state? GraalPython also supports HPy and looks like the folks at RustPython are interested in it, and are planning to implement it at some point since it's gaining attention in the Python community (and note that HPy can be implemented gradually, since it's made to allow for gradual code migration)

I'm wondering if you think this would beneficial for Nimpy with HPy's current state?

Does CPython implement it yet?

Does CPython implement it yet?

HPy is a third-party project (but not a part of stdlib). And certainly, HPy supports CPython.

I'm wondering if you think this would beneficial for Nimpy with HPy's current state?

Does CPython implement it yet?

HPy can compile itself to CPython's ABI natively and has the benefit of working on other Python implementations with speeds much better than trying to reimplement CPython's API