SWIG
Home PageCategories: Interoperability
Latest version: 1.3.33
Added 2005-02-10
Development tool that connects programs written in C and C++ with a variety of high-level programming languages.
SWIG (Simplified Wrapper and Interface Generator) is used with different types of languages including common scripting languages such as Perl, Python, Tcl/Tk and Ruby. The list of supported languages also includes non-scripting languages such as C#, Common Lisp (Allegro CL), Java, Modula-3 and OCAML. Also several interpreted and compiled Scheme implementations (Chicken, Guile, MzScheme) are supported. SWIG is most commonly used to create high-level interpreted or compiled programming environments, user interfaces, and as a tool for testing and prototyping C/C++ software. SWIG can also export its parse tree in the form of XML and Lisp s-expressions.
The C# module offers an automated way of accessing existing C/C++ code from .NET languages. The wrapper code implementation uses the Platform Invoke (PInvoke) interface to access natively compiled C/C++ code. Swig C# works equally well on non-Microsoft operating systems such as Linux, Solaris and Apple Mac using Mono and Portable.NET.
The Java extension to SWIG offers a way of accessing existing C/C++ code from Java. SWIG writes the Java Native Interface (JNI) code for you. It is different to using the 'javah' tool as SWIG will wrap existing C/C++ code, whereas javah takes 'native' Java function declarations and creates C/C++ function prototypes. SWIG wraps C/C++ code using Java proxy classes and is useful if you want to have access to large amounts of C/C++ code from Java.
Built for Java |
Free or free version available |
Source code provided |