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

Beating the Averages

This is a review of the reading Beating the Averages by Paul Graham,  which you can read here .   Our resistance as humans to learn new things is expressed in a function named the learning curve. The learning curve represents in a mathematical form of how we learn through time. It accomplishes this by taking into the equation experience with a particular subject or topic and placing it vs learning. In particular, I like this funciton because it represents one of the author's main points: why we tend to prefer what we already know. What this function represents is that we tend to have some resistance to new knowledge. We may apply this resistance through contradicting knowledge that we might already have, namely, experience in a certain field, maybe because it a new paradigm to see things, very different from what we are used to. As we grow older, it becomes harder and harder to change the way we see things. The Paul Graham, the author, expresses this himself, he say...

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...

Dick Gabriel on Lisp

So this post is going to be about the high and downs of LISP. You can check out the amazing talk that Dick Gabriel gave on LISP history, it's capabilities and what he calls " The winter of LISP" . Go ahead and check it out here . I thinks it's a little bit sad to think about how great LISP is and all the capabilities that it has, and just see it as "God". We can not bring God down to earth so easily. Some of us, may go ahead and try and check it out, and then just think... wow... how the hell didn't I thought about this that way before? It really hasn't been that long since I started learning what LISP is about. Today is about the third week I believe (maybe fourth, I don't know) since I started. And I already feel that this language should be the language of the future. After listening to this guru of LISP research, one of the biggest name in the community, it just made me feel a little dull. Knowing that everything is so cool on LISP, how ...