« The Economics of Colonizing Other Planets | Main | A New Version of Alloy »

Lisp as an 'Improved XML'

Steve Yegge's old blog, Stevey's Drunken Blog Rants, contains a lot of good reading for anyone interested in programming.  I particularly like his post The Emacs Problem in which he demonstates convincingly that the ancient programming language Lisp is better at representing structured text than the currently fashionable XML.  Here is a sample Java error log in XML:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE log SYSTEM "logger.dtd">
<message>A very very bad thing has happened!</message>

And here is the same in Lisp:

(date "2005-02-21T18:57:39")
(millis 1109041059800)
(sequence 1)
(logger nil)
(level 'SEVERE)
(class "java.util.logging.LogManager$RootLogger")
(method 'log)
(thread 10)
(message "A very very bad thing has happened!")
(message "java.lang.Exception")
(class "logtest")
(method 'main)
(line 30)))))

Not only is the Lisp version shorter, less verbose and clearer, it also doesn't require you to learn another half dozen half-baked programming languages and frameworks in order to be able to write a program to read it and process it.

The older I get, the less patience I seem to have with unnecessary syntactic baggage, and more attractive I find Lisp's simplicity.  However, for the time being I think I will stick with Haskell.

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.
Author Email (optional):
Author URL (optional):
All HTML will be escaped. Hyperlinks will be created for URLs automatically.