[Python-3000] Ctypes as cross-interpreter C calling interface

Jean-Paul Calderone exarkun at divmod.com
Mon Aug 14 19:20:00 CEST 2006

On Mon, 14 Aug 2006 09:09:49 -0700, Guido van Rossum <guido at python.org> wrote:
>On 8/14/06, Jean-Paul Calderone <exarkun at divmod.com> wrote:
>>On Mon, 14 Aug 2006 08:31:31 -0700, Guido van Rossum <guido at python.org> 
>> >After thinking about it some more, IMO for most purposes ctypes is
>> >really quite sub-optimal. I think it would make more sense to work on
>> >Parrot support for Python. Sure, in the short term  ctypes is more
>> >practical than Parrot -- in its most recent incarnation, the latter
>> >doesn't even list Python as a supported language -- a regression from
>> >last year when Python support was among the best. But in the long
>> >term, Parrot (like .NET or Jython do in other contexts) offers
>> >cross-language interoperability, and perhaps even (like .NET and
>> >Jython) automatic generation of wrappers.
>> >
>>This is a joke, right?
>No. Why would it be a joke? Because it's a Perl thing? Because it
>doesn't acknowledge Python's obvious supremacy in the universe of
>languages? Because it admits that other projects sometimes have good

Heh.  Strawmen, all.  I assure you, none of these objections ever entered
my mind.

>Because it's a good idea to have to write separate wrappers
>around every useful library for each dynamic languague separately?

If a project has done this successfully, I don't think I've seen it.  Can
you point out some examples where this has been accomplished in a useful
form?  The nearest thing I can think of is SWIG, which is basically a

This is not to say that it is not a noble goal, but I think it remains to
be shown that Parrot is actually a solution here.

>Because Parrot isn't real? IMO it's pretty real already -- the 0.4.6
>release supports Ruby, Javascript, Tcl, and a bunch more (possibly
>even Perl 6 :-). I wouldn't be surprised if Parrot reached maturity
>around the same time as Py3k.

Parrot has been around for quite a while now without accomplishing anything
much of practical value.  Does anyone _use_ it for Ruby, JavaScript, or Tcl?
(I know no one uses it for Perl 6 ;)

For five years of development by a pretty large community, that's not showing
a lot.  The reason I suspected a joke is that you seem to want to discard a
fairly good existing widely used solution in favor of one that's just vapor
right now.  Granted Py3k is a ways off, but it's not /that/ far off.  We're
talking about a year or two here.  Is Parrot going to be as solid in a year
as ctypes already is?  I doubt it.

If you /really/ want to look outside of the Python community for solutions
here, the lisp community has thought about this for a long time.  Instead of
looking at Parrot, you should look at the ffi provided by almost any lisp


More information about the Python-3000 mailing list