Thursday, June 26, 2014

Sweating and Coding

I was hearing about Google Summer of Code for past quite a few years. I used to see the program being announced, many organizations are being selected. From big names like Debian, Fedora, The Linux Foundation and also many organizations that I never heard about. But still I was afraid to make the jump. Thinking so many things I have to know for the proposal only, how can I even be selected.

Three years have passed like this, just watching. But this year I thought lets make the jump and lets see what happens at the most they will reject me. And Whoa! I got selected.

My proposal was to implement bookmarking support in pysoy library. In the first few days what I found out
  1. libsoy(library of pysoy) is written is Genie. So, I have to learn it then only I will be able to code.
  2. pysoy uses XMPP for user authentication. 
That meant, I need to acquire some idea of both XMPP and XML as XMPP messages are sent in XML format. Also the bookmarking support standard is drafted in XEP-0048. So I had to read that also.

My work till now consisted mainly of two parts.
i) writing the JID class for handling and validation JIDs.
ii) bookmark class providing the back-end support for getting, saving and deleting the bookmarks. 

And of course, reading things like XEP-0060, XEP-0029 required for these two.

For the JID class, I first thought lets do it simply by pattern matching. The idea failed because simply searching for @ and / wont help. As, according to the grammar (XEP-00 ) there may be multiple @ and /. Next two ideas - Recursive Descend Parser(RDP) and LALR parser constructing it by hand. Both ideas failed as the grammar was not in "nice" form as they give in books. It contained regular expressions(Now, I am thinking about it, probably it is in EBNF form). So, I went the middle way, a bit by pattern matching and a bit like RDP. What is not implemented is raising exception in case of bad JIDs.

The bookmarking standard draft is quite well documented in XEP-0048. But what I feel that the page is not self-sufficient. One has to read the publish-subscribe(XEP-0060) to get more idea. Otherwise one will have many question, like "what will happen if I change this value?" or "What will happen in case of error?". These are not evident when reading, but is bound to come when implementing. But I must say XEP-0060 was comprehensive enough. Another thing what I did not get in XEP-0048 is how to delete a bookmark. It should have been there. But deleting is written in pub-sub(XEP-0060).

For XMPP communication libsoy uses loudmouth library. Now its documentation is available in www.valadoc.org but for some classes(like Lm.MessageNode) only the names of the public members are given and not their details. So, many times I have to resort to original loudmouth documentation. Though they are given for loudmouth C API, the class and the function names are similar. So, it was not hard to navigate through it.

Right, those were some of my experiences till now, what I faced when coding. The mid evaluations have already started. I have coded the bookmarking part, but it still needs polishing. Now what it remains is building the GUI part using gnomesoy. I know its going to be much harder than this part, but I am kind of determined to complete this now, irrespective of whatever is going to happen in the midterm evaluation.