rootsoflisp.txt 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. May 2001
  2. (I wrote this article to help myself understand exactly
  3. what McCarthy discovered. You don't need to know this stuff
  4. to program in Lisp, but it should be helpful to
  5. anyone who wants to
  6. understand the essence of Lisp — both in the sense of its
  7. origins and its semantic core. The fact that it has such a core
  8. is one of Lisp's distinguishing features, and the reason why,
  9. unlike other languages, Lisp has dialects.)In 1960, John
  10. McCarthy published a remarkable paper in
  11. which he did for programming something like what Euclid did for
  12. geometry. He showed how, given a handful of simple
  13. operators and a notation for functions, you can
  14. build a whole programming language.
  15. He called this language Lisp, for "List Processing,"
  16. because one of his key ideas was to use a simple
  17. data structure called a list for both
  18. code and data.It's worth understanding what McCarthy discovered, not
  19. just as a landmark in the history of computers, but as
  20. a model for what programming is tending to become in
  21. our own time. It seems to me that there have been
  22. two really clean, consistent models of programming so
  23. far: the C model and the Lisp model.
  24. These two seem points of high ground, with swampy lowlands
  25. between them. As computers have grown more powerful,
  26. the new languages being developed have been moving
  27. steadily toward the Lisp model. A popular recipe
  28. for new programming languages in the past 20 years
  29. has been to take the C model of computing and add to
  30. it, piecemeal, parts taken from the Lisp model,
  31. like runtime typing and garbage collection.In this article I'm going to try to explain in the
  32. simplest possible terms what McCarthy discovered.
  33. The point is not just to learn about an interesting
  34. theoretical result someone figured out forty years ago,
  35. but to show where languages are heading.
  36. The unusual thing about Lisp — in fact, the defining
  37. quality of Lisp — is that it can be written in
  38. itself. To understand what McCarthy meant by this,
  39. we're going to retrace his steps, with his mathematical
  40. notation translated into running Common Lisp code.