I understand that the local TCL group (SDTCL) has been talking about swig.
{tcl people -- skip to last para and read the quoted excerpt preceding that]
I see that python has a foreign function interface tool, ctypes
http://starship.python.net/crew/theller/ctypes/
It actually looks like it makes access to libraries almost as easy as if
they were builtin .. no 'steenkin wrappers needed!
Does anyone have any experiendce with ctypes? I did run across a remark
that it opens the possibility of crashing python, as well as some
responses whitewashing(?) that point somewhat.
The reference above says ctypes is actually in python 2.5, so perhaps
some more whitewash^Wprotection has been added?
I had been aware of swig for some time, but never felt the need to go
beyond the simpleminded demos in perl. perl also has some additional
tools such as h2xs that are reputed to make extensions easier.
Anyone interested in xs might enjoy the 5-part example project at
http://world.std.com/~swmcd/steven/perl/pm/xs/intro/index.html
In this article there's even a brief suggestion of how to use swig in
it's easiest role (quoted next)
"""
Now you have to decide whether you want to write XS, or whether you just
want to get the job done.
If you just want to get the job done, consider using the Simplified
Wrapper and Interface Generator (SWIG). SWIG is a software development
tool that connects assorted application programming languages, such as
Perl, Python, and Tcl, to assorted system programming languages, such as
C, C++, and Objective-C.
SWIG is very easy to use. At its simplest, you just hand it your .c
file, tell it what your application language is, and it does the rest.
Here's an example, adapted from the SWIG documentation:
unix> swig -perl5 -module example example.c
unix> gcc -c example.c example_wrap.c
unix> ld -G example.o example_wrap.o -o example.so
unix> perl5.005
use example;
print example::factorial(4), "\n";
"""
I do notice that there is a -tcl language option (among a couple dozen
total).
Regards,
..jim
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg