Skip to content

SWIG 4.0 Development

William S Fulton edited this page Dec 30, 2018 · 11 revisions

SWIG 4.0 Development

This page is for adding ideas for improvements to the next major SWIG release (SWIG-4.0). SWIG is a volunteer project, so if you have an idea, please volunteer to implement it or find a contributor who can, otherwise it is unlikely to be coded up.

The list of improvements earmarked for SWIG-4.0 are labelled with the swig-4.0 milestone. These are issues or pull requests that introduce too much change for the 3.0.x release series.

The major features for swig-4.0 are covered below.

Doxygen documentation

C#, Java, Python #170 gsoc-2012-doxygen. This has currently been reviewed by wsfulton, but could do with tidying up and formatting correctly. Introduces a dependency on the STL.

Doxygen support was merged into master on 2018-06-07.

Python improvements

Minimum Python version support

The minimum version of Python to be supported is Python 2.7 and Python >= 3.2 (as discussed in #701).

Simplifying Python options

There are over 50 command line options for the Python module, many of which are essentially undocumented. The plan is to drastically reduce these, and to ensure that the remaining options are actually properly documented. A lot of the reduction will be possible by removing the minimum version of Python supported. The default set of options could be the same as when the optimization flag, -O, is used in swig-3.0.x. The first step towards making this work requires the Python test-suite to support -O in swig-3.0.x.

Support for -O in python test-suite

This branch: contains all the pull requests for getting -O to pass all tests. The individual fixes are done as separate pull requests (which have comments and discussion). The pull requests are:

  • #724 - merged in for swig-3.0.11 release
  • #721 - superceded by 86fd5c and merged in for swig-3.0.11
  • #718 - fixed for swig-4.0.0
  • #711 - superceded by #730 (see below)
  • #730 - merged in for swig-3.0.11 release
  • #1293 - fixed for swig-4.0.0

This work was completed on 10 Aug 2018 when #1298 was fixed.

Python command line options

#1340 is tracking the progress of all the Python options and whether they should be removed.

This work was completed on 18 Dec 2018 when #1340 was fixed.

Better standard containers typemaps for Java

Make std::vector<> conform to standard Java containers interface, notably allowing convenient iteration over it using the for-each loop: done in #842.

There are several other planned improvements to standard containers, see this comment and #1356.

Go changes

-cgo is required since Go 1.5, which is two years old now (Go 1.9 is the current release). Ian says we should make -cgo the default in SWIG 4.0 (

You can’t perform that action at this time.