On 2012/12/06 7:16 AM, Michael Droettboom wrote: > I think this has been a very helpful and useful discussion. > > I'm going to attempt to summarize this discussion and propose some ways > forward here. > > The impetus for this discussion is that PyCXX seems to be not adequately > maintained. It is difficult to build matplotlib with "vanilla" PyCXX in > certain configurations. (This history sort of predates this thread). > > So we have some options: > > 1) One way forward is to offer to take ownership of the PyCXX project. > (I'm not using the "f" word here... I'd much prefer to just become more > involved upstream somehow). I don't think this would be considerable > additional work, as most of that work has been done in matplotlib for > some time anyway. To the extent that it needs new features, it would be > killer to add support for Numpy so Numpy no longer required manual > reference counting. I had initially dismissed this approach, as I seem > to be in the minority in liking PyCXX -- I happen to think it's > fundamentally an extremely good approach to the problem: it helps with > reference counting errors, but otherwise mostly stays out of the way. > But I'd like to remove any one person as a bottleneck by choosing > something that's more preferred all around. > > 2) Move to a different wrapping mechanism of some sort. While Cython is > the clear choice for a third-party Python/C wrapping tool, it seems to > be polarizing. (I won't attempt to repeat or summarize, but I think > good points have been made on either side of the argument). I think > it's ok to allow Cython to be used in matplotlib, given that we include > both the Cython source and the generated C in the source repository such > that matplotlib can be built without Cython installed. There are many > other projects doing this that can provide best practices for us. I > don't think, however, that we can or should require that all wrapping is > done with Cython. I think we should allow raw Python/C API where it is > most appropriate (and that is mainly in the case of wrapping third-party > libraries, such as the png module and the macosx module which is already > raw Python/C API). What I wouldn't want to see is the use of more than > one wrapping tool, if only for reasons of proliferation of dependencies. > (I count the Python/C API as "free" since it's always available > anyway). I haven't seen in this discussion anyone really pushing for > any of the alternatives (SWIG, Boost.Python, etc.) in any event. > > Note also, the goal is to deal with the PyCXX "problem", not rewrite > large chunks of our existing and well-tested C/C++ code base in Cython, > unless someone sees a real clear benefit to doing that for a particular > module and is highly motivated to do the work. This is primarily about > refactoring the code so that the interface layer between Python and C is > separated and then replaced with either Cython or raw Python/C API using > the most appropriate tool for the job. > > 3) Any other options...? > > Cheers, > Mike
Mike, That is an excellent summary. The options actually are not mutually exclusive; perhaps what we are considering is more in the line of nudging evolution in one direction or the other, not pushing for rapid extinction of a species. Regarding PyCXX, I respect your opinion that it is a good match for what it does. To the limited extent that I can work with C++ at all, I don't have any problem with its use in mpl. I do share the concern about depending heavily on it, given that problems with it have cropped up, and you have been the only one willing and able to deal with those problems. Since PyCXX is a pure C++ construct, perhaps other C++ gurus--and it seems that we now have more than previously--would be willing to take a closer look at it, and reconsider whether they can relieve the single-person-bottleneck problem. There is always a tradeoff between going to a higher-level language or library versus sticking with lower levels. Personally, I like C over C++ because the former is simple enough that I can generally figure out what is going on; but I like Cython over raw Python/C API because its internal complexity allows an external simplicity, hiding all sorts of things I really don't want to have to think about. Going to higher levels always brings the risk of dependency on a complex system, whether it be Cython or PyCXX or Agg, or even the C/C++ compiler itself. The cost/benefit ratios of such tradeoffs vary greatly with the situation, and from person to person, depending on training, experience, and personal quirks. So we just have to keep looking for the balance that is appropriate to the task, the times, and the people at hand. Your summary nicely facilitates that balancing act. Eric ------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel