complexitystudies

metaphysics, philosophy, and a vision of the future

complexitystudies header image 2
Print This Post Print This Post

Revenge of the Nerds

December 26th, 2006 · No Comments · Last updated: July 18th, 2008

I found this per chance - an interesting article on Lisp features which have gradually merged into other languages and are now taken for granted - the whole article is very readable, so go click ;-)

Revenge of the Nerds
What Made Lisp Different

When it was first developed, Lisp embodied nine new ideas. Some of these we now take for granted, others are only seen in more advanced languages, and two are still unique to Lisp. The nine ideas are, in order of their adoption by the mainstream,

1. Conditionals. A conditional is an if-then-else construct. We take these for granted now, but Fortran I didnt have them. It had only a conditional goto closely based on the underlying machine instruction.

2. A function type. In Lisp, functions are a data type just like integers or strings. They have a literal representation, can be stored in variables, can be passed as arguments, and so on.

3. Recursion. Lisp was the first programming language to support it.

4. Dynamic typing. In Lisp, all variables are effectively pointers. Values are what have types, not variables, and assigning or binding variables means copying pointers, not what they point to.

5. Garbage-collection.

6. Programs composed of expressions. Lisp programs are trees of expressions, each of which returns a value. This is in contrast to Fortran and most succeeding languages, which distinguish between expressions and statements.

It was natural to have this distinction in Fortran I because you could not nest statements. And so while you needed expressions for math to work, there was no point in making anything else return a value, because there could not be anything waiting for it.

This limitation went away with the arrival of block-structured languages, but by then it was too late. The distinction between expressions and statements was entrenched. It spread from Fortran into Algol and then to both their descendants.

7. A symbol type. Symbols are effectively pointers to strings stored in a hash table. So you can test equality by comparing a pointer, instead of comparing each character.

8. A notation for code using trees of symbols and constants.

9. The whole language there all the time. There is no real distinction between read-time, compile-time, and runtime. You can compile or run code while reading, read or run code while compiling, and read or compile code at runtime.

Running code at read-time lets users reprogram Lisps syntax; running code at compile-time is the basis of macros; compiling at runtime is the basis of Lisps use as an extension language in programs like Emacs; and reading at runtime enables programs to communicate using s-expressions, an idea recently reinvented as XML.

Technorati Tags:

TrackBack Url for this entry:
http://www.complexitystudies.org/2006/12/26/revenge-of-the-nerds/trackback/

Tags: mathematics

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment