[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Python bindings

From: Lele Gaifax <lele_at_nautilus.homeip.net>
Date: 2004-05-12 12:03:21 CEST

>>>>> "Ben" == Ben Reser <ben@reser.org> writes:

    Ben> SWIG is complicated becasue it is a complicated problem to
    Ben> solve. Pyrex avoids a lot of that by:

No, there's nothing complicated in building a binding layer, at least
when compared to developing svn itself.

    Ben> a) Requiring you to rewrite the interface specifications in
    Ben> its syntax.

This is what SWIG force you to do too, and worst its syntax is
definitively neither Python, nor Perl, nor....

    Ben> b) Only supporting one language.

    Ben> The benefits of SWIG come about by solving the multiple
    Ben> language problems in many cases and not forcing you to update
    Ben> a separate interface for every change.
    Ben> This doesn't always work in practice.

This is just an opinion, not supported by the reality. Can you show a
single example of a library that was swigged into multiple language
and provides good bindings?

    Ben> Our code is littered with callbacks which are complicated to
    Ben> make work and are language specific, especially when trying
    Ben> to make the callback work right in a language with automatic
    Ben> garbage collection. As a result, some changes do require
    Ben> updates to the SWIG bindings. But these are the exception,
    Ben> not the rule.

Ben, *please*: a callback is as simple as calling whatever other
function/method, it's not the bottleneck of the matter. And I do not
see how the automatic garbage collection should make this more
difficult. Python do little magics, and is perfectly prevedible. See
where PyObjC has gone, and in that case, there are two distinct
garbage collectors at work, not only Python's....

    Ben> Regarding your specific complaint, I haven't looked at the
    Ben> Python bindings, but I can't imagine what is so difficult
    Ben> about --no-auto-props.

Well, do it, and you will recognize that, as simple as it can be for
you, it will require you to tweak a method for every language, thus
loosing the swig benefit you cited right from the beginning.

    Ben> But to suggest that we should ditch SWIG now (with so much
    Ben> work already done) and use Pyrex is similar (IMHO) to saying
    Ben> "Subversion should have been written in Java," followed by a
    Ben> great deal of debate about the merits of Java.

You evidently travised what I said.

    Ben> None of it really matters, the point is unless the Java
    Ben> people (or Pyrex people) are willing to spend the time to
    Ben> reimplement what is already done with C (or SWIG).

I did not ask you or anybody else to do that. You seem in confort with
the current bindings sit, and this is very good for you. But do not
waste your time trying convince everybody that the same should apply
for them.

ciao, lele.

-- 
nickname: Lele Gaifax	| Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas	| comincerò ad aver paura di chi mi copia.
email: lele@seldati.it	|		-- Fortunato Depero, 1929.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed May 12 12:04:04 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.