SWIG and XML and Python

Dave Kuhlman dkuhlman at rexx.com
Thu Oct 10 23:20:06 CEST 2002

David Abrahams wrote:

> Dave Kuhlman <dkuhlman at rexx.com> writes:
>> SWIG 1.3 can now generate XML documents.  These XML documents describe
>> the interface fed into SWIG.
> Interesting. How does this compare with projects like GCC_XML and

I am not well-educated on GCC_XML, however from a quick read at the GCC_XML 
Web site (http://www.gccxml.org/HTML/Index.html), GCC_XML produces XML that 
describes your *code*.  SWIG 1.3 with the "-xml" option produces XML that 
describes the *interface* to your code.   This is a bit over-simplified, 
but you can use SWIG 1.3 with "-xml" to produce an XML description of your 
C/C++ .h header files, whereas you can use GCC_XML to produce an XML 
description of your .c and .cpp/.cxx source code files.

Or, for those of you who want information that you can use, GCC_XML could be 
used as a front-end to a compiler, whereas SWIG 1.3 with "-xml" could be 
used as a front-end to a tool that makes interfaces (code libraries, etc) 
and descriptions of them available to programming tools.

And for those of you who are not familiar with SWIG, this XML stuff is not 
its primary use.  SWIG is normally used to produce scripting language 
extensions from C/C++ code.  For example, and importantly, you can 
(sometimes) feed a C or C++ header file to SWIG, and it will produce 
wrappers that enable you to use the functions and classes described in that 
header from Python.  It's in the same ecological niche as Boost.  Yes?  No?  
David, I see "Boost" in your Sig.  Could you give us a quick comparison of 
SWIG and Boost, please.

> Synopsis?

Don't know about this one.  "Synopsis" is too common a term, so a Google 
search did not give me anything useful.  Do you have a link?  Now, you have 
*me* interested.

  - Dave

Dave Kuhlman
dkuhlman at rexx.com

More information about the Python-list mailing list