IntroductionThis article is intended to be a quick overview of the Lisp family of languages, providing a glimpse into what makes the language different from other programming languages. First of all, many people think that Lisp is for AI and only for AI. Questions of the form "How do you do AI with Lisp?" commonly pop on on discussion forums. Although historically the main use of Lisp in decades past was for AI research, you can do AI in other languages, and you can do other things (such as graphics, UI, scripting, databases) in Lisp. Lisp is a computer language, much like other computer languages. Most of the language overlaps in functionality with "modern" languages such as C, C++, Python, and Java. What makes Lisp interesting are those features which set it apart from the other languages, and from which much of the attraction for (and disdain of) the language stem. The Lisp FamilyThere are currently two main dialects of the Lisp language in use. The first is Common Lisp, which is an industrial strength ANSI standard language with many powerful built-in features such as exceptions and object oriented facilities. The second is Scheme, which is a small, very elegant, minimal language which in some ways is even more powerful than Common Lisp. For simplicity's sake, we will use Scheme for our discussion and examples, though almost all we say will be equally applicable to Common Lisp. Lisp And CMuch of the programming in Lisp involves the same sort of things one does in other languages:
Anyone who knows how to program in C should be able to look at the Scheme examples above and understand what they do. Let's look a bit closer at how the Scheme code differs from C:
So how is Lisp different from C? What does it do that C does not? And what's up with all those parentheses anyway? There are a number of ways in which Lisp differs from C:
The last two points merit more discussion, as they are what sets Lisp apart from most other languages. People who have never used these features do not realize their power, and therefore do not miss them when using other languages. Lisp programmers often immediately notice and rue the lack of these features when programming in other languages. The language you use shapes the way you think.
|
|