Executive Summary

Executive Summary

SWIG is an interface compiler that connects programs written in C, C++, and Objective-C with scripting languages including Perl, Python, and Tcl/Tk. It works by taking the declarations commonly found in C/C++ header files and using them to generate the glue code (wrappers) that scripting languages need to access the underlying C/C++ code.

John Ousterhout has written a paper that describes the benefits of scripting languages. SWIG makes it fairly easy to connect scripting languages with C/C++ code.

You might use SWIG in a number of ways:

SWIG is sometimes compared to interface definition language (IDL) compilers such as those you would find with systems such as CORBA and COM. Although there are a few similarities, the whole point of SWIG is to make it so you don't have to screw around with that stuff. If anything, it's much more of a rapid application development and prototyping tool. Specifically:

A number of papers and tutorials describing SWIG are available. You can also view a simple tutorial to see an example of SWIG in action.