[Xapian-devel] xapian golang binding

Olly Betts olly at survex.com
Thu Aug 28 23:29:43 BST 2014


On Thu, Aug 28, 2014 at 02:49:31PM +0300, Marius Tibeica wrote:
> I would like to create a golang binding for xapian. Has anyone made the
> necessary swig files for it?

I've not heard of anyone working on them, but I think they would be a
great addition.  Of the languages which SWIG supports which we don't yet
have bindings for, I think it's probably the one for which Xapian
bindings would be most useful.

> If not can someone who has experience with swig offer tips or
> ready-made files?

The bulk of the interface files for SWIG are shared - you need to create
a new subdirectory, and put a "go.i" or "golang.i" there, which sets up
some macros and then includes the shared files (which make use of the
shared macros).  How this works can be seen from looking at the existing
subdirectories for other languages (I'd look at more than one, as some
do a lot more tweaking than others).

There's not currently any explicit documentation of the process of
adding support for a new language via SWIG, but we really ought to have
some, so let's add some to xapian-bindings/HACKING as we work through
the process.

Are you wanting this for trunk or 1.2?

The set up of the interfaces files has changed significantly between
the two.  It'll be easier to do for trunk, but backporting will be
significantly more work than just diff+patch+trivial fix-ups.  Of course
we really need it for trunk if it's going to live beyond the 1.2 release
series.

Cheers,
    Olly



More information about the Xapian-devel mailing list