Skip to main content

The Roots of LISP

The Roots of LISP, by Paul Graham.


This is  one of the hardest readings that we had to do in the course. During our programming languages course we have been working with Clojure, a new dialect of LISP that makes everything a little bit more readable. Trying to extrapolate everything we know in Clojure to LISP is not hard, but it's not trivial either. So if you want to go ahead and read The Roots of Lisp, by Paul Graham, you better have a solid foundation of Clojure or any LISP dialect that you are familiar with.

So after giving you this brief introduction let's get right into a review to this reading.

Paul Graham made a review of what John McCarthy found when he discovered this new dialect for making mathematical notation more readable. Let's get into the main points of the reading, so that you can go ahead and read it again by yourself.

1.- Using lists for both data and code.

One of the things that's probably the most weird to understand is this little sentence right here, using lists for both data and code.

To understand this you have to understand first how the quote operator works. The quote function simply returns the value that it receives unevaluated. For example if we write:

> (quote '(+ a b))

=>'(+ a b)


As you can see, the quote operator left everything it received as an argument unevaluated, even though what it received was actually a function that's supposed to sum a and b. Which leads us to the second thing you have to understand.

Functions are called through lists. As a matter of fact everything in Lisp is translated into lists and understood through them. Consider this examples:

> (+ 1 2)
=> 3

So functions are understood through lists as well, where the first element of the list is the function to be applied and the rest of the elements of the list is the arguments that the function uses to execute.


Now consider the fact that you can leave certain parts or certain function calls unevaluated, that gives the programmer the possibility to understand how Lisp code is made internally, which is a very powerful function because then you can write interpreters for practically any other Lisp dialect without having to dig a lot into them.


Comments

Popular posts from this blog

Revenge of the nerds, by Paul Graham.

So, once again we go to Paul Graham and his absolute amazing opinions on lisp. He understands the difficulty in changing the industry, but faces this with a good sense of humor and courage. You can check out his blog entry here . Taking it to the next level So the story goes like this. Michael Phelps went out there to change the world of an olympic sport. And did. Only he and his coaches know what he is doing differently but definitely, he is. Michael Phelps is such a good example because before Phelps, it was very rare to think of a swimmer that could do all the strokes in a competition, from crawl from breast stroke to his olympic record breaking butterfly stroke. In a sense, Phelps is like lisp. Phelps came to the 2004 Athens olympic games as a kid, he was only 19 years old, but everyone knew he had the chance to break the olympic record for 7 gold medals in the same event. He went on it and won 8 of them. So... what is he doing differently than any other swimmer? How long does

The semicolon wars by Bryan Hayes, reviewed.

I'm not an expert progammer, but I've been working with differnet programming languages for about 3 years now. I'm still a newcomer to this whole new world of opportunities with thechnology and programming... I don't think that the fact that I'm slim matters (a-ha) , since I think I've learned a lot in this past years. The point of view presented by Bryan Hayes is really interesting, and appealing. Starting out the course with a "let's go LISP!" seems like a good reading. But I've come across another good reading: "How to Choose a Programming Language: don't" and you can read it here . As I have said before, I'm not yet an expert in the languages in which I feel the most proeficcient, but as one of my professors once told us: A specific requierment requieres an specific technology, and not the other way around. Since thinking about Technology setting us new requierements doesn't always make sense, since it may not be

Rich Hickey on Clojure

So Clojure is a new programming language developed by a person named Rich Hickey. You can hear about the features of this programming language  here . The developer of Clojure then states what we feared the most, we were right. Lisp language wasn't firstly thought to be used by everyone. In one of my previous posts you can hear another podcast by Dick Gabriel on why did Lisp languages fail so bad. You can go ahead and read my review on that podcast too, to which you can find a link in the post too. Basically it explains that lisp failed because of many many things, but mainly because of what he calls " the winter of lisp" and how did artificial intelligence made lisp languages fail so bad. Now there is a new hope, another lisp like language has been developed, and it still in it's early days, but it already addresses many of the problems that lisp had, and added some cool new features. Some of the solutions that Clojure provides are: Interoperability with th