Tags Lisp

A couple of days ago a typical post appeared in the comp.lang.lisp newsgroup. In his post, titled "Lisp and Scheme with fewer parentheses", the poster suggested "using a lisp/scheme with Python-style indentation for lists". That is, indentation instead of the parentheses. Sample code:

   defun factorial (n)
     if (<= n 1)
       ^ 1
       * n
         factorial (- n 1) 
Expectedly for comp.lang.lisp, the post triggered a few acrid responses. But I've raved about this already. Now I want to discuss something else.

It eludes me why people want to take from Lisp the one feature that makes it superior to all the other programming languages - the list representation of code using those so-hated parentheses. In his wonderful book Paradigms of Artificial Intelligence programming, Peter Norvig lists seven features of Lisp that make it different from (and better than) other languages. Those features are:

  • Built in support for lists
  • Automatic storage management
  • Dynamic typing
  • First class functions
  • Uniform syntax
  • Interactive environment
  • Extensibility

Now, recall that the book was written in 1993, when there was yet no Java and the dynamic languages were in diapers. Compared with C++, Ada and Pascal, these features truly make Lisp stand out.

But this no longer is the case ! Perl shares six of these features with Lisp. So does Ruby, which also adds excellent object orientation on top. Guess which feature they don't share, though... Uniform syntax, of course. Uniform syntax - this wonderful feature of Lisp which makes code the same as data, allows the omnipotent macros that make the language so powerful. And this uniform syntax goodness is what those parentheses are for ! The Lisp concept of "form" - a list of symbols enclosed by opening and closing parentheses, which can either be data or code, is uniform syntax.

So, let me return to my original question. What on earth makes people want to take Lisp and remove the one feature that makes it so special ? If you have a problem with uniform syntax, just use Ruby or Perl.