[Xapian-devel] GSoC 2011 - Improve Existing Bindings

James Aylett james-xapian at tartarus.org
Sun Mar 20 14:28:15 GMT 2011


On 20 Mar 2011, at 12:25, Abdul Rauf wrote:

> Dear Olly,

I've added myself in as a potential mentor on the bindings projects, so I'll answer this in the first instance.

> I am very excited to contribute in open source community through the platform of Google Summer of Code 2011. I have visited the ideas of “Xapian” at http://trac.xapian.org/wiki/GSoCProjectIdeas for GSoC 2011. I am interested in working on “Improve Existing Bindings”. The reason for my interest is that I have previously worked on .NET related projects both in VB and C#. I also have worked on C++ projects.

Excellent.

> I am writing to let you know my understanding of the project and would like to have a feedback on it. My understanding of the requirements is as follows:
> 
> 	• To study current bindings. In case of C#, I am studying this link (http://xapian.org/docs/bindings/csharp/)
> 	• To implement improvements in the current bindings.
> 
> Would you please refer me some material to study in this regard?

Beyond the link you already have, the main information about the C# bindings will be the SWIG code itself, in xapian-bindings <http://svn.xapian.org/trunk/xapian-bindings/>. SWIG bindings split into two parts: there's generic code shared across all the bindings (the *.i files in the xapian-bindings root), and language-specific files (in a subdirectory; there are two main files, util.i and extra.i; generally speaking util.i is for SWIG "typemaps", which convert arguments between the target language and C++, while extra.i is currently only used by the python bindings to inject additional python code, mostly to provide more idiomatic iterators).

> Also what kinds of binding improvements are required by Xapian? I look forward to your response.

The intention of bindings is to be as idiomatic in the target language as possible; so for instance we rename methods and classes to match the language conventions where possible. (There's a lot of this done for C# already, mostly automatically by SWIG, but it's obviously worth checking if there's anything missing there.) More work, but considerably more rewarding, is ensuring that core language idioms such as iteration are supported, rather than having to use C++ idioms. (It's been a long while since I played with C#, so our bindings may already be in good shape here.)

As the project summary indicates, there's some default SWIG wrapping going on which can probably be improved. The ultimate aim is that a C# programmer should be able to think in a C# way when using the bindings.

Beyond that, providing detailed examples (SWIG C# supports directors, meaning that user code written in C# can be passed as callbacks to some parts of Xapian, so it would good to provide some examples of this), suitable tests (you don't need to test Xapian itself in detail through the bindings, but you do need to test anything specific to that language, and obviously some general functionality tests are also good), and documentation are all important. In addition to the docs on the website / shipped with the code (which you've found), it may be possible to automatically generate C# XML doc comments; we do something similar in Python.

James

-- 
 James Aylett
 talktorex.co.uk - xapian.org - devfort.com - spacelog.org






More information about the Xapian-devel mailing list