HPy - 用于 Python 的更好的 C API

  • What is HPy?: Provides a new C API for extending Python, using #include <hpy.h> instead of #include <Python.h>.
  • Advantages of HPy:

    • Zero overhead on CPython.
    • Faster on alternative implementations.
    • Universal binaries.
    • Migration path for mixing C-API and HPy API calls.
    • Debug mode to detect common problems.
    • Nicer API with fewer limitations.
    • Evolvability as internal details are hidden.
  • Current status: Under active development, with 0.9.0 as the latest alpha release. The HPy ABI is stable, and the API covers enough use cases for migrating important packages.
  • HPy-compatible extensions: Ultrajson-hpy (first ported module), piconumpy (minimal numpy-like module), numpy (ambitious port close to passing test suite), matplotlib (close to universal mode with legacy compatibility API), kiwi-solver (fully ported). Benchmarks show little impact on CPython performance and close-to-CPython performance with GraalVM Python.
  • Where we need help: Documentation (limited resources), publicity (get more package developers interested), tooling (migration helper tools), packaging (open questions), website and logo design (lack of expertise).
  • More info: Documentation, HPy blog, Github repository, Discord server, IRC channel (obsolete), mailing list. HPy is pronounced /h/ - pie or /eɪtʃ-paɪ/.
  • Recent blog posts: No specific content provided about recent blog posts.
阅读 23
0 条评论