The Emacs Problem Revisited

Saturday, I wrote about Slava Akhmechet’s The Nature of Lisp, which discussed why Lisp is such a powerful language. A day or two afterwards, I serendipitously came across a tweet pointing to Steve Yegge’s old post, The Emacs Problem. That’s a really great post and if you haven’t read it yet, you definitely should. I’ve written about it a number of times including here and the series of posts starting with this one on treating data as code. Those last posts are among my favorites in the Irreal canon. Among other things they demonstrate the power of Emacs viewed as a kind of Lisp Machine.

Yegge’s and Akhmechet’s posts are complementary. They both start by considering XML as the solution for a problem and show that

  1. Expressing the data structure as an S-expression makes it less verbose and much easier to read.
  2. Once expressed as an S-expression, the data can be thought of as code and made to perform useful transformations on itself.

A lot of this boils down to Lisp being really good at text manipulation or, as Yegge puts it, the only language that’s really good at it—at least for non-trivial data. Yegge’s post starts by considering the notion that Lisp is terrible for text manipulation, that Emacs proves that, and that Emacs should be rewritten in some other language such as Ruby. By the end of his post, that notion is a smoldering heap of ashes.

Akhmechet, on the other hand, doesn’t consider Emacs at all. He just lays out the case that Lisp, although hard to grasp at first, is a very powerful language and very often the right solution. Emacs is, I submit, proof of that assertion.

This entry was posted in General and tagged . Bookmark the permalink.