Last night I had the strange sensation that as I was dreaming, my conscious mind was also turning over a programming idea, one that still kind of made sense when I woke up: what if I were to write a static site generator… in zsh?

Maybe it’s not as crazy as it sounds! Think about some of the things that shell scripts make easy:

And at a high level, what does a static site generator do?

For a number of reasons which aren’t particularly interesting, I’ve grown dissatisfied with Jekyll, the tool that generates this site right now, and I’ve been thinking about the form a replacement might take. (Like many hapless programmers, I would want to create my own.)

I use Haskell and zsh for most of my hobby programming. The former would be the obvious candidate for a Serious Application like a static site generator, but maybe the latter is suited to the problem domain too. To be sure, it wouldn’t be very fun to parse my Markdown files’ YAML headers with a shell script; there are disadvantages to using a language whose two types are “string” and “strings.” Shell scripts are also not exactly known for their speed. But zsh in particular lets you write text manipulation one-liners which in Haskell would require a Ph.D. and three Monoid instances.

If I do take the plunge and write my own static site generator, I’ll probably end up doing it in Haskell. But I’ll keep the possibility of a zsh version in the back of my mind. I could call it Tartini.