[Python-ideas] discouraging direct use of the C-API

Andrew Barnert abarnert at yahoo.com
Wed May 6 21:57:57 CEST 2015


On May 6, 2015, at 12:49, Joao S. O. Bueno <jsbueno at python.org.br> wrote:
> 
>> On 6 May 2015 at 16:28, Guido van Rossum <guido at python.org> wrote:
>>> On Wed, May 6, 2015 at 11:56 AM, Paul Moore <p.f.moore at gmail.com> wrote:
>>> 
>>>> On 6 May 2015 at 17:41, Guido van Rossum <guido at python.org> wrote:
>>>> As for CFFI, is the ownership/maintenance issue solved yet? IIRC we have
>>>> some really outdated versions in the CPython tree and nobody wants to
>>>> step
>>>> in and upgrade these to the latest CFFI, for some reason (such as that
>>>> that
>>>> would actually break a lot of code because the latest version is so
>>>> different from the version we currently include?).
>>> 
>>> I think you are referring to libffi (used by ctypes) here rather than
>>> cffi.
>> 
>> 
>> Oh dear. I think you're right. :-(
>> 
>> Forget I said anything. Naming is hard.
>> 
>> I'm still not sure how realistic it is to try and deprecate the C API.
> 
> I am also not sure, but I feel like it would be a __huge__ step
> forward for other implementations
> and Python as a language instead of the particular cPython Software Product.
> 
> Today, many people still see using the C API as "the way" to extend Python,
> which implies in most extensions created being invalid for all other
> implementations of the language.
> 
> (Ok, I actually don't know if cython modules
> could be called from, say Pypy or Jython, but even if not, I suppose
> a "jcython" and "pycython" could be made available in the future)
> (fist-google-entry says cython has at least partial support for pypy already)

Yes, but PyPy also has pretty good support for
C API extensions, too.

For Jython and IronPython, I'm not sure what the answer could be. Could Cython automatically build
JNI thingies and wrap them up in Java thingies to expose them to Jython even in theory? Even if that worked, what about something like Skulpt? Compile to C code and jsctypes wrappers?

So I think there's a limit to what you can expect out of "extending Python the language" in any generic way.
>>   js
> -><-
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/


More information about the Python-ideas mailing list