More permanent stuff at http://www.dusbabek.org/~garyd

19 September 2008

Spare Hacking Cycles

Many programmers hack in their spare time. I am no exception. I tend toward music-related projects, but have fun doing almost anything that involves a keyboard and a little thinking.

I got around to looking at Snowl about a week ago. The concept is interesting by itself, but my main intent was to get familiar with Firefox plugin APIs. Having investigated things I bit, I think that Gecko as an application platform is an under-realized gem. The notion that entire rich, cross-platform desktop applications can be written mostly in Javascript is very appealing.

A few observations:
1. Plugin development is painful. Instead of waiting for changes to recompile, I find myself waiting as I restart Firefox. It is entirely frustrating because, having done a fair bit of Javascript/HTML programming, I am used to just refreshing a browser page. I'm curious what hardcore plugin programmers do to take the edge off developing.

2. For the uninitiated, the Mozilla API documentation is difficult to grasp quickly. Some of the Mozilla docs I ran into referred me to XULPlanet, the docs of which claim to be obsolete and refer me back to Mozilla. When I needed a DOM parser, I was able to quickly find that one was available (by examining Components.classes), but it took me a fair amount of time to find the right documentation that showed me how to use it. (It turns out that the DOM parser available to Firefox a plugin uses roughly the same API used by DOMParser in standard HTML/Javascript pages.)

3. The community is very helpful. This makes up for some of the shortcomings of the documentation. It also helps that there are many open-source Firefox plugins already available to learn from--a great feature of open-source software in general. This is a great ecosystem to be working in.

Snowl uses an SQLite database to keep track of messages and other data. One neat Firefox plugin that ended up helping me figure things out was SQLite Manager. Just point at a file and it does the rest.

I managed to figure out enough of the existing Snowl codebase that I got simple Audioscrobbler loved/banned track support implemented in about a day. More work needs to be done to make the scrobbler messages more interesting.

The changes I have made so far are available in my (newly created) public hg repo.

0 comments: