[GSoC] Go Bindings for xapian

Olly Betts olly at survex.com
Tue Mar 5 07:28:13 GMT 2019

There's no need to Cc me on list mail - I'm subscribed to the list (as
all mentors should be) so you just give me another mail to delete.

On Sun, Mar 03, 2019 at 03:15:55PM -0800, Shubham Rao wrote:
> I found a few new commits to the golang branch but wasn't able to determine
> what exactly is happening
> My current understanding is that SWIG reads a some interface definitions
> (defined in .i) to output a xapian.go file, is it correct?

Yes.  This sets up various typemaps and then gets SWIG to parse the
Xapian C++ API headers (so in many cases just adding a new method
to the C++ API gets it wrapped automatically).

The current wrapped Go API is pretty much just what comes out of SWIG by
default, but SWIG's default wrapping is sometimes not what we want (you
can't always tell the meaning of parameters in C/C++ just by seeing the
types - e.g. (int, double*) could be a pointer to an array of double and
the number of elements in it, or an integer parameter and a pointer to a
single double to return the result in.

And sometimes we want more idiomatic wrapping than SWIG gives (e.g. C++
iterators typically have an end iterator to compare with, but in other
languages there may be a method on the iterator to test for the end, or
the increment method may return a flag saying if there's any more data).

> Can you please help me how to get started? I have cloned and compiled the
> xapian code but I don't know how to proceed from here, specifically about

You could look at the current Go API for something to improve and have a
go at trying to improve it.

Or you could try adapting the branch to be based on git master instead
of RELEASE/1.4, since new development work should be done first on git

Or pick something which isn't directly related to the project you
have in mind to start with.  That at least means you can get to grips
with modifying the code and working through the process of submitting
a patch and getting it reviewed.  Our GSoC guide has some pointers
to generic things suitable for someone new to the codebase to work on:



More information about the Xapian-devel mailing list