Beginning of wp2o2b

I recently made the decision to start doing my blogging using org2blog. I’ve been using WordPress to host a couple of blogs (Radios Appear and Gurave, as well as my friend Chet’s blog Miscellaneous Heathen) for the last couple of years, but I’ve always done my writing in Emacs (using Textile for formatting), and then simply cut-and-pasted what I wrote into WordPress’s text entry box: of course a more integrated solution based entirely in Emacs sounded attractive.

And, indeed, I like the results. In addition to the original two blogs, I’m using this workflow to write my articles about exploring Emacs (Do You Even Lisp?) as well as this blog (I gave some serious thought to Brent Yorgey’s Blog Literately package, appropriately written in Haskell, but first, the Debian Haskell situation is in a lot of flux right now and I didn’t want to have to work that hard to package it and second, a little consistency of tooling is always welcome).

Being the sort of compulsive neat-freak that I am, though, I decided that it wasn’t enough to just create new articles using org2blog—what I really wanted was to export all the existing articles in my long-term blogs into my org2blog setup.

I was originally going to do this using Perl—it’s been my go-to language for the last 17 years, I can whip up what I want in it faster than in anything else, and I’ve been doing it long enough to write code that is readable after the fact. Besides, I already have a script for doing some WordPress interaction, so it would be a great starting point.

And then I decided that I was going to do it in Haskell (which I have come to realize was probably an even better choice than I initially expected—I’ll talk about that later).

So, the task is to download all the articles in my existing sites, reformat them into org-mode files with appropiate metadata for org2blog, store them locally in a hierarchy that mirrors the one on the server.

I think it’s going to be easier than I expected.

Welcome to Functional Paradise!

I first started programming in 1980 on a Heathkit H-8 in Basic (Benton Harbor) when I was 10, and in the intervening 30-odd years I’ve programmed more-or-less competently in Basic, Modula-2, C, Turbo Pascal, Clipper, C++, Rexx, Bourne Shell, Perl, PHP and Javascript.

I’ve also been exposed to many other languages—Forth, COBOL, Fortran, Java, C#, Ruby, Python, and so forth. By exposed I mean I can read and perhaps divine the intent of simple, straightforward code, but wouldn’t easily understand complex code or write anything of any significance.

And of course I’ve probably forgotten most of that stuff anyway—I have no memory of even the barest syntax of Modula-2, say—not that I suppose it matters much: if you look at that list there’s not a whole lot to strongly distinguish one language from another.

Sure, some are strongly typed and some are weakly typed and some are compiled and others aren’t, but in the end they’re all imperative languages (sometimes with functional features baked in), and the ones that I’m really familiar with all fall into the general ALGOL family of languages.

Which is why Haskell has been so interesting to study and attempt to use—which is what I’ve been doing for the last year or so. And I still feel like I’m taking baby steps.

Like a parent dutifully taking home videos of those baby steps, I’ve decided to do a little log of my work with Haskell, both to remind me of what I’ve accomplished and perhaps entertain others.