SWIG image
Home Development Mailing Lists Bugs and Patches
Information
What is SWIG?
Compatibility
Features
Tutorial
Documentation
News
The Bleeding Edge
History
Subversion
Guilty Parties
Projects
Legal Department
Links
Download
SwigWiki
Exits
AllegroCL
C# - Mono
C# - MS .NET
CFFI
CHICKEN
CLISP
Guile
Java
Lua
MzScheme
Ocaml
Octave
Perl
PHP
Python
R
Ruby
Tcl/Tk
Our Generous Host
SourceForge logo

Welcome to SWIG

[ Chinese ]

SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages. SWIG is used with different types of languages including common scripting languages such as Perl, PHP, Python, Tcl and Ruby. The list of supported languages also includes non-scripting languages such as C#, Common Lisp (CLISP, Allegro CL, CFFI, UFFI), Java, Lua, Modula-3, OCAML, Octave and R. Also several interpreted and compiled Scheme implementations (Guile, MzScheme, Chicken) 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. SWIG may be freely used, distributed, and modified for commercial and non-commercial use.

Recent News SWIG RSS Feed

2008/10/08 - SWIG's First Summer of Code
SWIG is a programmers tool for semi-automating the calls to C or C++ code from almost any other programming language. The idea is to feed C/C++ header files into SWIG and SWIG then generates the 'glue' code so that your C/C++ library can be used from another language such as Python, Java, C#, Ruby, Perl etc. In fact there are implementations for supporting over 20 different of these target languages. The summer of code students have had a productive summer and have extended the number of languages and features supported in SWIG's first Google Summer of Code.

Haoyu Bai has added support for the upcoming Python 3 release. Python is the most popular target language amongst SWIG users and no doubt this addition will be much appreciated by those who are thinking of upgrading to Python 3. Also Haoyu has provided new Python 3 features which make coding faster and simpler when using Python extension code. The main features added are function annotations, buffer interfaces and abstract base classes and are outlined in more detail here: http://swig.svn.sourceforge.net/viewvc/swig/branches/gsoc2008-bhy/Doc/Manual/Python.html#Python_python3support

Jan Jezabek has added a new 'language' module providing Windows Component Object Model (COM) support. This new module makes it possible for any COM enabled language to easily call into C or C++ libraries. The COM module in SWIG is more powerful than most as it ultimately provides support for more than one language as there are numerous languages that can call into COM libraries. Compiled languages such as Visual Basic and scripting languages, such as JScript, VBA and VBScript that can run on the Windows Scripting Host are probably the most popular to benefit. A great use will be the ease of making C/C++ libraries available in applications supporting the various Basic dialects, such as OpenOffice.org and Microsoft Office. SWIG makes it easy to utilise more advanced C++ code, such as templates, and the COM module is no different here as Jan has added in very comprehensive coverage of the C and C++ languages, full details here: http://swig.svn.sourceforge.net/viewvc/swig/branches/gsoc2008-jezabek/Doc/Manual/COM.html

Maciej Drwal has added a module for calling C++ code from C code. It is now possible to automatically create a flattened API of C++ classes so that the C++ functionality is available in the form of easy to use C structs and global functions. For example, features such as C++ template classes / functions are easily callable from C. One cool part of this project is the graceful handling of C++ exceptions in the calling C code. Some introductory documentation is available here: http://swig.svn.sourceforge.net/viewvc/swig/branches/gsoc2008-maciekd/Doc/Manual/C.html

Cheryl Foil has added an interesting feature to improve code documentation in the target language. This works when C/C++ code is documented using the industry standard Doxygen tool for annotating methods, classes, variables etc. The new feature extracts the Doxygen comments from the code for use by one of the many target languages. Cheryl has added initial support for Java so that the Doxygen comments are turned into JavaDoc comments embedded into the generated Java wrappers, see http://swig.svn.sourceforge.net/viewvc/swig/branches/gsoc2008-cherylfoil/Doc/Manual/Doxygen.html

Lastly, many thanks to the mentors involved in making this happen, Ian Appru, Olly Betts, Richard Boulton and William Fulton and finally to Google for funding a great programme. (0 comments)

2008/06/24 - SWIG-1.3.36 released
SWIG-1.3.36 has been released. The major changes are listed below.

- Enhancement to directors to wrap all protected members
- Optimisation feature for objects returned by value
- A few bugs fixes in the PHP, Java, Ruby, R, C#, Python, Lua and Perl modules
- Other minor generic bug fixes (0 comments)

2008/04/21 - Summer of Code students
The students accepted into the Google Summer of Code have now been announced. SWIG has managed to get four slots and we have chosen the following four projects/students:

* "SWIG's Python 3.0 Backend" - Haoyu Bai tutored by Richard Boulton
* "C target language backend" - Maciej Drwal tutored by William Fulton
* "Comment 'Translator' for SWIG" - Cheryl Marie Foil tutored by Olly Betts
* "Support for generating COM wrappers" - Jan Jezabek tutored by Ian Appru

The competition was tough and although it was difficult choosing the projects, these four were our strongest, so congratulations and welcome to Haoyu, Jan, Cheryl and Maciej. Further details on the Google SWIG page - http://code.google.com/soc/2008/swig/about.html . (0 comments)

2008/04/07 - SWIG-1.3.35 released
SWIG-1.3.35 has been released. This release adds Octave to the list of languages modules that SWIG can generate wrappers for. This release also contains a few bug fixes and regression fixes from the previous release. (0 comments)

2008/03/18 - SWIG accepted onto Google Summer of Code
SWIG is one of 175 open source organizations that have been accepted onto the Google Summer of Code (GSoC) 2008. GSoC is a program to pay students and in the process benefit open source - http://code.google.com/opensource/gsoc/2008/faqs.html . Students interested in submitting an application to work on SWIG are invited to look at the ideas page (http://www.dabeaz.com/cgi-bin/wiki.pl?DeveloperInfo/GoogleSummerOfCode) and then discuss them on the mailing lists before submitting a project proposal. (0 comments)

2008/02/27 - SWIG-1.3.34 released
SWIG-1.3.34 has been released. This release adds shared_ptr support for Python and fixes a number of various other bugs. (0 comments)

2007/11/23 - SWIG-1.3.33 released
SWIG-1.3.33 has been released and fixes a few regressions introduced into version 1.3.32. (0 comments)

2007/11/15 - SWIG-1.3.32 released
SWIG-1.3.32 has been released. This release contains over a hundred bug fixes and improvements to most language modules. (0 comments)

2006/12/14 - Revision Control Change
SWIG has now moved to using Subversion (SVN) for revision control. See the new SVN instructions for details of how to access our SVN repository - http://www.swig.org/svn.html . (0 comments)

2006/11/20 - SWIG-1.3.31 released
SWIG-1.3.31 has been released. This fixes a Python regression in the last version. (0 comments)

More news


Feedback and questions concerning this site should be posted to the swig-devel mailing list.

Last modified : Sun Oct 5 21:19:43 2008