GSoC weekly report: NCI updates for parrot-libgit2

Hello everyone,

This was my first week of GSoC working on parrot-libgit2. parrot-libgit2 is aimed at providing a low-level PIR binding to libgit2 as well as high-level winxed bindings. The schedule is available here. Duke Leto wrote the initial code a couple of years ago, but since then the code had bitrotted.

Therefore the first week of the project was aimed at updating the low-level bindings to newest release of libgit2(0.18). Most of the work is done by a script, which tries to parse the libgit2 headers for function signatures and generate NCI defs. I expected it to be quite broken, considering the changes in libgit2 but mostly minimal changes were required. I got first hand experience with perl regexes for parsing signatures, and I was helped by Bruce in writing/debugging one.

Bob, who has worked on parrot-gmp, helped me point out the NCI-related problems that I'm going to face. Most of the generation seems to be handled accurately by the script. But there are problems with many definitions, most notably these are going to be seen in functions which have callbacks and a couple of functions which have varargs. I'm going to tackle these problems as they come while writing higher-level code, but the rest of the functions are ready for calling.

What next? For one, the lower level API is not going to be directly helpful to many people because they will have to manage the objects and structs passed to the functions manually. These details shouldn't be ideally exposed to the user! So the high-level interface is next, as mentioned in the schedule. Also, libgit2 0.19 got released yesterday. So there will be one more round of def updates, before I mark issue 14 as closed. The code is available in nciupdate branch.