Sunday, December 21, 2008

Thursday, December 4, 2008

The Long Tail of Software Reuse

I have been an enthusiastic user of open-source software for years, yet I have never really contributed to any project started by someone else, nor have I started anything but dead ends myself. I may be a control freak with a short span of attention, but too short for what? Another way of seeing things is that the open-source projects that I have started have been too ambitious given my limited resources of time, patience, and enthusiasm.

The open-source hosting services that I used before becoming a GitHub user, namely SourceForge.net and Google Code, are built for hosting medium to large projects, not for incubating small projects. At SourceForge.net, each new project is individually approved, and at Google Code, you have a lifetime creation limit of ten projects. Ten ideas are not a lot for a person to have in a lifetime. I must have started a hundred software projects over the years. Would SourceForge.net or Google Code have allowed me to create that many? I doubt it. But GitHub does. I can create as many repositories as I like, as long as I stay within my file quota. That is fertile ground indeed for the incubation and organic growth of software projects.

A couple of weeks ago, I looked through the code of Wormbane, a roguelike computer game that never made it past barely playable. Wormbane does however have working implementations of the A* search algorithm and a field-of-view algorithm, and I had even taken the time to write unit tests and demos before running out of steam. Extracting the algorithm implementations into separate projects and publishing them on GitHub as python-astar and python-fov has to rank among my best spent time as a software developer, yet at SourceForge.net or Google Code, I would not have bothered. There would have been too much overhead, both for the administrators and for me.

Wednesday, December 3, 2008

Hosting LuaRocks Repositories at GitHub

GitHub has recently started supporting clean URLs for raw file access. The old, cluttered kind of raw URLs looked like this:
http://github.com/elemel/rocks/tree/master/import-0.1-1.rockspec?raw=true
The new, clean kind looks like this:
http://github.com/elemel/rocks/raw/master/import-0.1-1.rockspec
The new kind of URL allows you to host LuaRocks repositories at GitHub. Mine is at:
http://github.com/elemel/rocks/raw/master
To create your own LuaRocks repository at GitHub, follow these steps:
  1. Create a GitHub repository named e.g. rocks and change directory to your local clone of it.
  2. Copy your rockspec files to your working directory.
  3. Make a manifest: luarocks-admin make_manifest .
  4. Stage (add), commit, and push your rockspec files and manifest to GitHub.
  5. Add the raw URL string for your repository to the rocks_servers array in your config.lua file.
The tarball and zipball URLs of GitHub are convenient in rockspec files. For an example, see the rockspec file for import referred above. If you have trouble browsing a repository, try appending a slash to the URL.

Update: I have moved my LuaRocks repository to my GitHub Pages.