Search code examples
perlprogramming-languageslisp

Greenspun's 10th rule in Perl?


Greenspun's Tenth Rule of Programming is a common aphorism in computer programming and especially programming language circles. It states:

Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp.

The questions are,

  1. Would you consider this to be true of Perl interpreter? Only objective arguments please (e.g. which features of Common Lisp are implemented within the interpreter)

  2. Independently, does there exist a Lisp (or at least a n ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp) implemented entirely in Perl?


Solution

  • You might like the preface (as well as the rest of the book) for Mark Jason Dominus's Higher-Order Perl, whose subject is essentially your question. He says:

    If you pick up a good book about Lisp, there will be a section that describes Lisp's good features. For example, the book Paradigms of Artificial Intelligence Programming, by Peter Norvig, includes a section titled What Makes Lisp Different? that describes seven features of Lisp. Perl shares six of these features; ...

    Mark has many other things to say about Lisp and Perl

    So, Perl is already Lisp, practically, but I'd say neither slow nor half. One of the things that Mark points about about the difference between Perl and Lisp, however, is that Perlers deal with unstructured strings (in general) while Lispers deal with structured data whenever possible. Perl can do that, but Perlers tend not to do that.