Monday, November 16, 2015

Python C API, PyPy and the road into the future

tl;dr; We are willing to commercially support CPython C API in PyPy, so if you want pypy to support library X, get in touch with me at fijal@baroquesoftware.com. Read further for more details.

Python owes a whole lot of its success to the ease of integration with existing POSIX APIs and legacy applications. For the most parts, this means calling C (or Fortran) using various ways with the Python C API being the most commonly used one, either directly or with the help of tools like Cython.

Historically, calling C was one of the sore points of PyPy. We originally had no way to do it, then we implemented ctypes which is loved by few, hated by many. Next we went ahead and implemented cffi which is both a better way to call C and a much better supported one. cffi has been a stunning success, becoming one of the most commonly used pypi package with over 1.5mln downloads happening every month and growing.

This addressed the basic problem of PyPy -- how do I call C? It has however not addressed a very important problem -- "how do I integrate with legacy applications?". We were willing to take a step further, implementing a subset of CPython C API, labelling it "forever beta", "incomplete" and "slow", just to support the legacy software.

Now, to address the growing need, we're willing to take a step further. We discussed ways to make the CPython C API faster and more stable with the promise of supporting it completely in the future. However, since it is about supporting mostly legacy codebase, me and my company, baroquesoftware want to structure it as a commercial contract.

This is an open bid to find funding primarily through commercial partners to implement speed and completeness improvements to CPython C API and pool it together into pypy. The end product will be available, for free for everyone under the MIT license, but the funding will be structured as a commercial contract with all the benefits of one.

Get in touch with me, preferably using mail at fijal@baroquesoftware.com for more details regarding what can be done for what sort of budget.

Best regards,
Maciej Fijalkowski


1 comment:

  1. Maciej: I'm personally intrigued but not totally sure what would be possible once this were implemented. Maybe a short summary of what limitations would be lifted by this would help casual readers like me.

    ReplyDelete