[GSoC] Implement Bindings for Go
Olly Betts
olly at survex.com
Sun Mar 11 05:05:10 GMT 2018
Hi Marco,
On Fri, Mar 09, 2018 at 11:51:48PM +0200, Marco Younan wrote:
> I already went through the test repo
> (https://github.com/mtibeica/xapiango/blob/master/xapian_test.go) .
Note those are the generated files - the sources are here:
https://github.com/mtibeica/xapian/tree/master/xapian-bindings/go
> I was wondering what I could be doing the next weeks. any
> mini-projects/tasks suggested I may start with?
> or you advise me with any steps. to makesure I have the required
> experience to execute the project and getting more deep with it.
The prototype bindings mtibeica did above are pretty much what you get
out of SWIG with very little manual tweaking. SWIG does a good job by
default in a lot of cases, but in others you really need to do some
manual work to guide it (typically by writing custom typemaps) to get a
wrapped API which feels natural to use in the target language (Go in
this case).
There's a talk about this in the context of Python a few years ago with
audio and slides which should give a flavour of the sort of things
involved:
https://survex.com/~olly/talks/pythonic-swig/
You can also look at the ".i" files in the language-specific
subdirectories for the other languages we already wrap using SWIG.
Exactly what needs doing varies by language, though there are some
commonalities - e.g. exceptions and iterators usually benefit from some
special attention - and some of the languages have had more work put in
than others, so I'd look at several to get an idea.
It's probably a good idea to try to do something related to the project,
so either a "bitesize project" or "GoodFirstBug" issue which is to do
with the bindings, or pick something in the prototype Go bindings which
could be wrapped better and try to improve it.
Cheers,
Olly
More information about the Xapian-devel
mailing list