- Greenspun's Tenth Rule
Greenspun's Tenth Rule of Programming is a common
aphorism incomputer programming and especially programming language circles. It states: [http://www.paulgraham.com/icad.html Revenge of the Nerds] , byPaul Graham .]Any sufficiently complicated C or
Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half ofCommon Lisp . [ [http://philip.greenspun.com/research/ Philip Greenspun's Research ] ]Origin
The rule was written sometime around 1993 by
Philip Greenspun . Although it is known as his tenth rule, there are in fact no preceding rules, only the tenth. The reason for this according to Greenspun: "Sorry, Han-Wen, but there aren't 9 preceding laws. I was just trying to give the rule a memorable name." [ [http://philip.greenspun.com/bboard/q-and-a-fetch-msg?msg_id=000tgU 10th rule of programming ] ]Meaning
The interpretation is that programmers, constrained by low-level, primitive tools like C, often work around the limitations of their languages by inventing and implementing features found in more expressive languages such as Lisp.
Morris's Corollary
Well-known hacker Robert Morris later added the
corollary :…including Common Lisp [http://store.yahoo.com/paulgraham/quotes.html Paul Graham quotes] .] .
This can be viewed as a commentary on the difficulty of creating an efficient implementation of the large and complex Common Lisp language, or simply a joke about LISP's eval function and the general commonality of recursion in functional languages. Both Greenspun's rule and Morris's corollary are examples of a characteristic style of hacker humor known as "ha ha only serious". [ [http://www.catb.org/jargon/html/H/ha-ha-only-serious.html Jargon File entry on "ha ha only serious"] ]
(Nonetheless, most Common Lisp systems are not written in C or Fortran. Exceptions exist, such as
GNU CLISP ; however, systems such asSteel Bank Common Lisp are written chiefly in Lisp itself, just as C compilers are usually written in C.)Prolog follow-up
Any sufficiently complicated
LISP program is going to contain a slow implementation of half ofProlog . [ [http://groups.google.com/groups?threadm=f08bdd6e-2f87-441a-8ba0-7406446ec153%4025g2000hsx.googlegroups.com comp.lang.prolog: why not use LISP-imp of Prolog as opposed to Prolog itself?] ]Addresses the fact that pure Prolog programs are likely to include Lisp-like isles, and pure Lisp programs are likely to do the converse.
Generalization
The rule is often modified by replacing "Common Lisp" with the speaker's functional language of choice, such as Scheme or Haskell. It can also be generalized as:
Any sufficiently complicated platform contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of a
functional programming language.Fact|date=April 2008ee also
*
Inner-platform effect
*Turing tarpit
*Zawinski's law of software envelopment References
Wikimedia Foundation. 2010.