[SciPy-dev] Major CVS changes to weave
eric at enthought.com
Thu Sep 12 15:34:02 CDT 2002
> Hi Eric,
> On Thu, Sep 12, 2002 at 02:10:22AM -0500, eric jones wrote:
> > 2.
> > I've switched from CXX to Gordon McMillan's SCXX for list, tuples,
> > dictionaries. I like CXX pretty well, but its use of advanced C++
> > (templates, etc.) caused some portability problems. The SCXX
> > similar to CXX but doesn't use templates at all. This, like (1) is
> > API compatible change and requires repairing existing code.
> > I have also thought about boost python, but it also makes heavy use
> > templates. Moving to SCXX gets rid of almost all template usage for
> > standard type converters which should help portability.
> I don't mean to second-guess your decision, especially since I know
> of the details of SCXX nor of boost python. However, portability is
> probably one of the stronger reasons to switch TO boost. Those guys
> absolutely rabid about supporting a wide variety of compiler/platform
> pairs. Boost is heavily templated throughout, but they still manage
> to build on a number of disparate compilers, so I figure they have
> the portable use of templates down to a science by now.
Well, this decision isn't cast in stone so I welcome other thoughts.
The main selling points of SCXX is that it is *tiny* (less than 900
lines), simple, and doesn't require templates. These are all good
things. It isn't quite as easy to use as CXX, but perhaps minor
modifications to clean up these "deficiencies". The other possibility
is that the deficiency is actually on my part in that I lack a complete
understanding of its usage. I'll know more about this as I use it more.
As far as boost, it is very enticing because it is the most actively
developed C++/Python project and David is extremely responsive. On the
other hand, it is large and has a the broad scope of generating wrapper
modules from existing C++ libraries. This requires a lot of machinery
and complexity. All we need for weave are C++ class that mimic lists,
tuples, and dictionaries nicely. Using boost for this looked like
overkill. Currently the only templates used for non-blitz weave stuff
is std::string and std::complex. By now, these guys *should* be
supported everywhere without issue.
The third option is just to forego the attempt to make lists, dicts, and
tuples look nice with C++ wrappers and just expose the raw PyObject*. I
think people who have written extension modules before would prefer this
while people unfamiliar with the Python API would not. I tend to try
and design for the new user and provide a workaround for expert. In
this case, py_xxx always provides the raw PyObject* version of variable
xxx while xxx is a "nicer" version of the same object.
My current opinion remains that SCXX is the best fit for what weave
needs. I'd be interested, though, if a boost expert can chime in on
what they think is required to extract the list, tuple, dictionary stuff
from boost and whether it is appropriate.
> > 6.
> > blitz++ was upgraded to the latest CVS. It compiles about twice as
> > as the old blitz and looks like it supports a large number of
> > (including SGI, Steve)
> Woohoo! Sounds good.
Thought you might like that. It looks like the effort to get this
working will be setting up a blitz++ config.h file with #ifdefs that
switch in the appropriate settings for a particular platform's compiler
instead of just including the gcc settings.
More information about the Scipy-dev