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

pyo3 bindings for uap-python #3

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

pyo3 bindings for uap-python #3

wants to merge 1 commit into from

Conversation

masklinn
Copy link
Collaborator

@masklinn masklinn commented Jul 15, 2024

  • can do the entire loading in one shot in pure rust from a python iterable
  • work using rust semantics
  • really just works
  • only requires a pyi for type declarations (?)

Tightly bound to cpython, no pypy or other alternate implementations.

It looks like pyo3 should support cpyext, so as long as this doesn't use any complicated feature (which it shouldn't) that should work but I can't really find docs so far so TBD. But anyway this should be workable for pypy, and graalpy also claims support for the API version of native packages which supposedly has pyo3 support as well.

So it should be possible to use this for pypy and graal, it might not be as fast as the cpython version but given how ultra slow "pure python" pypy and graal are (ua-parser/uap-python#220) that's likely still a massive gain.

masklinn added a commit to masklinn/uap-python that referenced this pull request Jul 15, 2024
masklinn added a commit to masklinn/uap-python that referenced this pull request Jul 15, 2024
@masklinn masklinn force-pushed the pyo3-bindings branch 16 times, most recently from 2e03dc7 to 14aaff4 Compare October 1, 2024 20:17
Advantages
==========

- Can do the entire loading in one shot in pure rust from a python iterable.
- Work using rust semantics.
- Really just works.
- Only requires a pyi for type declarations (?).

Drawbacks
=========

- Likely slower than cffi for pypy, but unlikely to be slower than the
  slog of pure python.
- Graal don't work in tox.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant