Boost logo

Boost :

From: edcjones_at_[hidden]
Date: 2001-06-12 21:01:05

Is any further development planned for Boost.Python?

I am a newbie at Boost.Python. I am not a newbie at SWIG having
painfully wrapped some large C libraries. So here are some thoughts.

1. A good thing about SWIG is that a lot of repetitious code is
generated automatically. Could code like
              this_module.def(greet, "greet");
be generated from
              std::string greet();

2. SWIG also partially solves the problem that "pointers have too many
potential meanings". It takes advantage of the fact that good
programmers use the same name for the same thing repeatedly. A
"unsigned char* lut" might always mean a 256 element array of one byte
integers. For this case, I have to write a piece of Python API code.
SWIG applies it only to "unsigned char* lut" arguments. Should there
be some way to instruct Boost.Python, perhaps via a C++ comment, what
kind of pointer some pointer is? Is there some way of telling
Boost.Python (or SWIG) what to do that is better than the SWIG
"typemap" that I find to be hard to write and understand?

3. If a C function looks something like
          void foo(int* array, int length) {...}
            int* bar(void) {
                 int n;
                 n = something();
               array = (int*) malloc(n * sizeof(int));
               do_something(array, n);
               return array;
then I find SWIG pretty much useless. I wrap it by hand. Could
"ivect","dvect", etc. help with this?

Ed Jones

Boost list run by bdawes at, gregod at, cpdaniel at, john at