[matplotlib-devel] Experiments in removing/replacing PyCXX

2012-11-29 Thread Michael Droettboom
Given the slow pace of development on PyCXX, I know it has been the 
desire of some here to remove our dependency on it.

I thought a helpful starting point to evaluate the alternatives would be 
to restructure one of our extensions to not use PyCXX anymore.  I've 
taken the PNG extension, which is reasonably straightforward in that it 
doesn't define any custom types, but does have some low level C-wrapping 
challenges, and separated out the Python-specific parts from the 
libpng-specific parts.  The Python-specific parts are now written using 
the "raw" Python C/API. The other part still uses C++ (not C) and does 
throw exceptions, but doesn't use classes or templates or anything else 
that can be difficult to wrap.  All of this is on my "no_cxx" branch.

Now here's the challenge: can we do better than this using any of the 
available wrapping tools?  Cython, SWIG, Boost.Python etc.? I've not had 
much luck with Cython for this kind of thing in the past, but I know it 
is popular.  Perhaps someone with more Cython experience would want to 
take a crack at this and then we could have something concrete to compare...

Cheers,
Mike

--
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Experiments in removing/replacing PyCXX

2012-11-29 Thread Michiel de Hoon
Hi,

The Mac OS X backend is entirely written in C (with some Objective-C elements 
where necessary). AFAICT, this is the largest C/C++ code in matplotlib. This 
backend was written from scratch without using Cython, SWIG, or Boost.Python. 
From my experience, I would prefer to write such extensions in C directly 
rather than relying on Cython, SWIG, or Boost.Python, because those approaches 
would lead to another dependency (for developers at least), and requires 
developers to learn how to code in them. Which may not be very hard, but we may 
as well avoid that if possible.

I'd be happy to help out with the conversion of the other extensions from CXX 
to C. I would need some help though to use github appropriately.

Best,
-Michiel.


--- On Thu, 11/29/12, Michael Droettboom  wrote:

> From: Michael Droettboom 
> Subject: [matplotlib-devel] Experiments in removing/replacing PyCXX
> To: "matplotlib-devel@lists.sourceforge.net" 
> 
> Date: Thursday, November 29, 2012, 11:59 AM
> Given the slow pace of development on
> PyCXX, I know it has been the 
> desire of some here to remove our dependency on it.
> 
> I thought a helpful starting point to evaluate the
> alternatives would be 
> to restructure one of our extensions to not use PyCXX
> anymore.  I've 
> taken the PNG extension, which is reasonably straightforward
> in that it 
> doesn't define any custom types, but does have some low
> level C-wrapping 
> challenges, and separated out the Python-specific parts from
> the 
> libpng-specific parts.  The Python-specific parts are
> now written using 
> the "raw" Python C/API. The other part still uses C++ (not
> C) and does 
> throw exceptions, but doesn't use classes or templates or
> anything else 
> that can be difficult to wrap.  All of this is on my
> "no_cxx" branch.
> 
> Now here's the challenge: can we do better than this using
> any of the 
> available wrapping tools?  Cython, SWIG, Boost.Python
> etc.? I've not had 
> much luck with Cython for this kind of thing in the past,
> but I know it 
> is popular.  Perhaps someone with more Cython
> experience would want to 
> take a crack at this and then we could have something
> concrete to compare...
> 
> Cheers,
> Mike
> 
> --
> Keep yourself connected to Go Parallel: 
> VERIFY Test and improve your parallel project with help from
> experts 
> and peers. http://goparallel.sourceforge.net
> ___
> Matplotlib-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> 

--
Keep yourself connected to Go Parallel: 
TUNE You got it built. Now make it sing. Tune shows you how.
http://goparallel.sourceforge.net
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel