Monday, July 25, 2011

On File Names

Many programs have input languages that they accept. Compilers and interpreters accept programs, web browsers accept web pages, database systems accept queries, and file systems accept file names. An input language can be a great way to get input from a user.

But programs should not be using these input languages when they communicate with each other. Why? Because if program A is manipulating strings in the input language of program B, then A is reimplementing at least some of the syntactic and semantic logic that is already in program B. These reimplementations, besides being wasted effort, tend to be brittle and buggy.

In some areas, we've made great progress in dealing with this problem. For example, there are many libraries which allow for the manipulation of program source code. But there is one input language in particular whose semantics are at least partially reimplemented by nearly every substantial program in existence: the language of file names.

Lest you think that the language of file names is trivial, consider all of these syntactic and semantic details which a robust program must consider:

  • Relative and absolute paths
  • Trailing slashes
  • Parent and self references
  • Special files (devices, pipes, directories, and symbolic links)
  • Hard links
  • Permissions (having a file name doesn't mean you can open it)
  • Existence (having a file name doesn't mean it exists)
  • Platform-specific issues, such as:
    • Supported characters in names
    • Special characters (like the path separator)
    • Whether or not particular kinds of links are supported
    • What permissions are supported
    • Oddities like Windows drives

Now, I will briefly consider solutions to this problem. Much more about solutions will come in a future post. Two options have come to mind:

  1. Provide a wrapper interface for existing file systems that understands and enforces all the relevant syntactic and semantic details.
  2. Provide a fundamentally different file system. This option is more powerful, and I have some ideas about how this power can be used which I will discuss in a future post, hopefully with a prototype implementation of such a file system.

Wednesday, March 2, 2011

Read This

Read this: On the cruelty of really teaching computing science by Edsger W. Dijkstra. Yes, it's a bit long, but it is best read carefully and completely.

Tuesday, December 7, 2010

Frontiers

Since I should be doing homework, here's a crossword puzzle: Frontiers.

As usual, I haven't done extensive proofreading: that's what my loyal readers are for. If you find anything that is or might be wrong, please tell me.

Saturday, October 30, 2010

Announcing Argon 0.2.0

I am pleased to announce the release of Argon 0.2.0, a declarative tiling window manager.

This release seems to be fairly solid. I have been using it for a week without any crashes. But, to be fair, my testing of features that I don't regularly use has not been extensive.

Anyway, Argon is now featureful, usable, and well-documented. Check out the website.

Sunday, October 10, 2010

Un-over-engineering the ACM Digital Library

I have a gripe with the ACM Digital Library website. It is too hard to get the BibTeX from an article's page. Now, you might be thinking that I am crazy. After all, the link to the BibTeX is right there.

Well, that link is stupid. Its real target isn't the BibTeX (in fact, it's the citation page you are already on). Thus, you can't right-click and save the BibTeX file directly. Instead, it helpfully opens the BibTeX in a new window via its onclick event handler. And that's actually the same window for every article, so if you find a bunch of articles and click all the BibTeX links thinking you will get something sensible, you actually get one window showing the BibTeX of whatever you clicked on last.

I have created an alternative. It's not perfect, but it only took about 45 minutes to create, including all the time needed to learn how to make and package an extension for Chrome. What this extension does is add an inline frame containing the BibTeX so you can copy it to your bibliography database.

One caveat: the extension is currently hard-coded to work on two domains: portal.acm.org and portal.acm.org.ezproxy.library.wisc.edu. The latter is how I browse ACM from home. I could change this to work more generally (and thus request more permissions upon install), but it already works for me. Go ahead and submit a patch if you want to.

Monday, October 4, 2010

Argon

Now that the pace of my schoolwork is starting to pick up, I have had less time to work on my window manager. But I have made progress. However, my claim that the first release was usable may have been premature. At least, it wasn't usable to me, and since I am my entire target audience, that is a bit of a problem. So, I will not be making another release until I have actually started using my window manager for my own window-management needs.

One other accomplishment is that my window manager is longer called "KDWM", which was rather dull. It now has a more exciting name: "Argon". But I didn't only choose this name because it did well in the focus groups. Argon (the window manager) was originally meant to be "declarative". When I began working on it, I had a few ideas about what that would mean to a window manager, and they all turned out to be wrong. Eventually, I dropped the word from every document—except the acronym, where it lived on in the letter "D".

I have since discovered that Argon is quite declarative indeed, and the new name is intended not only to sound wonderful but also to emphasize that fact. How does it do this? Argon, the element, is one of the noble gases, which means that its electronic configuration is stable enough that it almost never engages in chemical reactions. I want my Argon to exhibit a similar level of stability and predictability.

Saturday, September 18, 2010

Announcing kdwm 0.1.0

I am pleased to present the first usable release of KDWM, a window manager that does what I want. My work so far on KDWM has had two purposes: creating a tiling window manager that works exactly the way I want it to, and learning a lot about Haskell and window managers in general.

If you are just so excited that you want to start using KDWM right now, you can download it.

If you'd like to browse the source or read the user documentation (which is also included in the download package), visit Github.