Skip to content
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

Add support for Hpy #245

Open
Yu-Vitaqua-fer-Chronos opened this issue Dec 13, 2021 · 7 comments
Open

Add support for Hpy #245

Yu-Vitaqua-fer-Chronos opened this issue Dec 13, 2021 · 7 comments

Comments

@Yu-Vitaqua-fer-Chronos
Copy link

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

@Yu-Vitaqua-fer-Chronos Yu-Vitaqua-fer-Chronos changed the title Hpy Add support for Hpy Dec 13, 2021
@ghost
Copy link

ghost commented Dec 13, 2021

@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.

@yglukhov
Copy link
Owner

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

@Yu-Vitaqua-fer-Chronos
Copy link
Author

@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

@Yu-Vitaqua-fer-Chronos
Copy link
Author

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)

@yglukhov
Copy link
Owner

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

Does CPython implement it yet?

@GalaxySnail
Copy link

Does CPython implement it yet?

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

@Yu-Vitaqua-fer-Chronos
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants