Tuesday, April 26, 2011

The myth of the Lisp genius — The Endeavour - John D. Cook

Most programming languages are turing-complete; anyone with enough ingenuity and time can fulfill the same job with Lisp as they can with assembly.

Verbosity distinguishes programming lanugages. Because Lisp requires less typing than other languages, Lisp affords programmers the mental space to save more complex programs. That`s why AI is typically done in Lisp.

Java has been compared to the Catholic Church: change must follow downward from the Pope. To change Java, one must 1) convince the Sun/Oracle developers to acquire the change 2) wait for the change to be applied to Java 3) wait for the next stable Java release 4) wait for users to update their Java version. The action takes years.

In contrast, Lisp programmers can bend Lisp to their needs in minutes by using macros. You can set your own constructs (e.g. custom if-then`s and loops). You can enforce a special object system, or try with different threading models. In Java, or any other monolithic language, you get to go with what they make you.

There is some accuracy in a command like "Lispers are geniuses who program circles around lesser folk": Lisp does, in fact, enable programmers to do exactly that. Also, the mentality of functional programming can greatly ameliorate the character of code produced in any language: there is far too much ad hoc code that takes no input, manipulates global variables, and prints the results out rather than taking input, manipulating local variables, and returning output. That ad hoc code is USELESS.

There is also some truth that Lisp demands a higher quality programmer. IQ aside, many programmers are taught to believe that programming must be done imperatively (C-style). They`re basically using high level assembly, for all the contrivance of their chosen languages. And so they write new languages to add force to the old ones: Groovy, Scala, BeanShell.

Greenspun`s Tenth Rule is "Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp." The desire for more powerful languages has leave to the introduction of engines for scripting languages. It`s why web browsers have JavaScript, why video games use Lua, and why Windows has a half dozen application languages: the underlying languages are terrible, and good developers check to turn round them.

You don`t take to be a star to read Lisp or to use functional programming, but there is a correlation between Lispers and Computer Science education, interest in theory, and natural curiosity. A baby can learn BASIC, Lispers tend to have PhD`s.

No comments:

Post a Comment