[vtk-developers] Wrappers and signed char

tom fogal tfogal at apollo.sr.unh.edu
Fri Jul 22 11:56:07 EDT 2005


 <20050722133843.STRB29192.rrcs-fep-11.hrndva.rr.com at Grayson>"Ken Martin" writes:
>You can wrap VTK with SWIG using Cable (a C++ wrapper based on GCC and SWIG)
>This is how we wrap ITK. Having said that I'm not sure if VTK would wrap to
>your satisfaction without some additional customization. Stock SWIG isn't
>going to cut it. 

I think it might depend on the language. Personally I've recently gone
through and exported a C++ VTK-based app into python via SWIG. It was
just more difficult than I would have liked, but in the end it worked
great.

One might run into issues with other languages, which seem less popular
(and thus less used/tested) than python. In general though I'm of the
opinion that SWIG is becoming fairly mature. More importantly for me
though, is that SWIG seems to be the tool with the largest community
surrounding it, and I expect this to continue in the future.

I'm going way outside the scope of the original discussion now =), but
I feel this type of thing is becoming more and more important. One
issue is of course ease of use for (non-technical in particular) users.
The 'popular' tools are almost always included with a distribution
(although I'm pleased to see that gccxml is part of my distribution!).
More importantly for me is the opinion my successor has of me =). Down
the road (when someone else is maintaining my current software), they
will be more at ease with the 'standard' tool of the time, and probably
would be more readily able to find support for it. It is particularly
miserable to inherit code which uses some ill known library, only
works with a nonstandard compiler, or needs many dependencies which are
non standard.

That said, I think GCC XML is an amazingly good idea. I wish it would
be included in the mainline GCC tree, and in the very long run I think
it would be great if all compilers could export this sort of thing.
Then the 'appropriate' interface for any SWIG-like tool would be an XML
dump of the source (okay, probably daydreaming a little TOO much
there...).

I'll stop rambling now.

-tom

>> -----Original Message-----
>> From: vtk-developers-bounces+ken.martin=kitware.com at vtk.org [mailto:vtk-
>> developers-bounces+ken.martin=kitware.com at vtk.org] On Behalf Of tom fogal
>> Sent: Thursday, July 21, 2005 7:08 PM
>> To: vtk-developers at vtk.org
>> Subject: Re: [vtk-developers] Wrappers and signed char
>> 
>>  <42E006C8.3080306 at kitware.com>Brad King writes:
>> >David Gobbi wrote:
>> >> I saw that you added "signed char" support to the wrappers.  Adding new
>> >> types to the wrappers is good, but if you're not careful, you'll run
>> out
>> >> of available types pretty fast!  You're already up to 0xD, so only 0xE
>> >> and 0xF remain.
>> >
>> >When we run out of types we can just shift everything over one digit and
>> >then we'll have 256 types.  Alternatively someone could implement a real
>> >type system that is actually readable and avoids duplicating the
>> >enumerations in Tcl/Java/Python/ClientServer/etc wrapper generators.
>> 
>> Not that I foresee anyone picking up this task anytime soon, but it
>> would be really great if all this wrapping stuff switched over to using
>> SWIG. It seems to be very popular and I'm not sure if there are even
>> any other tools that could wrap the breadth of languages that VTK
>> supports.
>> 
>> Just my $0.02,
>> 
>> -tom
>> 
>> <snip>
>> _______________________________________________
>> vtk-developers mailing list
>> vtk-developers at vtk.org
>> http://www.vtk.org/mailman/listinfo/vtk-developers
>



More information about the vtk-developers mailing list