[pypy-dev] offtopic, ontopic, ...

Armin Rigo arigo at tunes.org
Tue Feb 14 16:12:16 CET 2012


Hi Stefan,

On Tue, Feb 14, 2012 at 14:12, Stefan Behnel <stefan_ml at behnel.de> wrote:
> Hmm, if that is so, how would you ever want to make PyPy bidirectionally
> interface with anything at all? How does ctypes even work in PyPy?

I believe you are not understanding my point.  Obviously ctypes works
in PyPy, and not, I believe, in a particularly "lucky" way at all.  It
works by not being written as C code at all, but as (Python and)
RPython code.  The difference of levels between C and RPython is
essential in PyPy.  I just gave tons of examples of why it is so.  I
know it's not a perfect solution for everybody; but we think that
writing C code (or generating it straight from something else) is not
the most flexible way to develop software.  You may not agree with
that, and you're free too; but consider that we would be unlikely to
have a JIT in PyPy at all without the approach we took, so we think
there is some merit in it.

Note that I'm pushing so much for a Cython that would emit Python code
instead of C --- but that's mostly for performance reasons on top of
PyPy.  The alternative, which is quicker and only slightly more
hackish, is to complete the C API of cpyext in PyPy until it works
well enough.  Don't come complaining "it's slow", though.  It *is*
going to be slow.


A bientôt,

Armin.


More information about the pypy-dev mailing list