Christopher Barker wrote:
>> http://www.artima.com/weblogs/viewpost.jsp?thread=95863
> 
> Thanks
>> (It was in Mike's original message.)
> 
> I must have missed that. Guido says:
> 
> """
> I've yet to see an extension module using SWIG that doesn't make me 
> think it was a mistake to use SWIG instead of manually written wrappers. 
> The extra time paid upfront to create hand-crafted wrappers is gained 
> back hundredfold by time saved debugging the SWIG-generated code later.
> """
> 
> hmm. wxPython is my prime example. I can't imagine that ever being done 
> enough to be useful without auto code generation. Period. Of course, 
> that doesn't apply to far smaller libraries.

I agree with you that some form of automation is absolutely necessary 
for these large libraries.  However, wxPython also proves, IMHO, that 
using SWIG specifically is no walk in the park.  wxPython has put a lot 
of effort into patching bugs in SWIG (which never seem to make it into 
upstream SWIG), and writing complicated extensions and workarounds.  It 
is not a silver bullet for reference counting -- wxPython has had 
reference counting bugs as recently as 2.8.3.  In fact, since SWIG 
typemaps are required so often (which is just raw Python/C API code 
anyway), there are still opportunities to make reference counting bugs, 
and they are harder to track down since you're one step removed from the 
real code.

> And many of the hand-written wrappers I've seen are nightmares of 
> incorrect reference counting. I think hand-wrapping is a just plain bad 
> idea, not when you have ctypes and pyrex and Boost (and CXX?) as options 
> instead.

I'll have to respectfully disagree with your assessment of 
hand-wrapping.  It is the least likely to become unsupported of any of 
these options, and the Python/C API has been reasonably stable over a 
number of revisions (certainly since new-style classes were introduced, 
at least), and is extremely well-documented.

Cheers,
Mike

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to