pwig project home (original) (raw)
news!
- version 0.6.0 released, synchronized with SWIG-1.3.23 and supporting new Prolog OO layer plo
- version 0.5.0 released, updated SWI-Prolog module with better Logtalk integration
- version 0.4.1 released, corrects some minor bugs
- version 0.4.0 that works with SWIG 1.2.21 released!
- version 0.3.3 released
- version 0.3.1 released
- pwig is now hosted at SourceForge
- Logtalk support added to SWI-Prolog module
what's pwig?
pwig is a SWIG extension that allows new language modules to be programmed inPython. It's mostly a SWIG wrapper for SWIG itself ;-)
modules
A fully working module for SWI-Prolog is included on the pwig distribution.
download
You can download pwig latest version from the SourceForge site
installation & requirements
To install pwig first you need to create a patched SWIG: Download SWIG-1.3.23 from the SWIG website and apply the path included with the pwig distribution. Rerun autogen.sh (optional, but recommended if you have the autotools installed), configure, make and install the resulting package:
$ tar xzf SWIG-1.3.23.tar.gz
$ cd SWIG-1.3.23
$ patch -p0 <.../pwig-x.x.x/patchs/swig-1.3.23.patch
$ ./autogen.sh # optional
$ ./configure
$ make
$ make install Then, you can install pwig with the usual configure,make, make install commands.
Important: use configure argument--with-swig=... to point to the patched SWIG:
$ ./configure --with-swig=/path/to/the/patched/swig
$ make
$ make install Step by step instructions are included on theINSTALL.pwig file from the pwig distribution.
example
There are several examples of wrapper generation with the SWI-Prolog module included.
To run them ...
$ cd examples/swipl/foo
$ make
$ mv config_sample.pl config.pl
$ vi config.pl # set Logtalk config
$ make testRemember that they need SWI-Prolog and Logtalk to work.
docs?
Docs about how to write new pwig modules are not available yet, but you can use the source from the SWI-Prolog module as an example.
Most of the extending SWIG docs still apply although you should be aware that several function and method names have been transformed to make them more consistent with Python common uses (greping the .i files for 'rename' reveals such transformations that are mostly prefix eliminations and case changes).
Docs about the SWI-Prolog module are available from here, you should also read theSWIG core documentation.
contact
I really like getting feedback about people using pwig, which kind of projects it's being used for, problems found, bugs, how can it be improved, etc. Use the project lists at SourceForge to send comments and questions and the bug tracking system to report bugs or if you don't like posting mails in public list, you can also send your comments to my personal address.
see also
pwig project resources (CVS, downloads, bugs, mainling list, etc.) at SourceForge: http://sourceforge.net/projects/pwig
Copyrigth (c) 2003 Salvador Fandiño García sfandino@yahoo.com