



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Project for CS 1621 - STRUCTURE PROGRAMMING LANGS at Pittsburgh (Pitt)
Typology: Study notes
1 / 6
This page cannot be seen from the preview
Don't miss anything!




CS 1621 – Structures of Programming Languages Project 1 Ryan Dunseath and Jim GreenSeptember 15, 2003
Lisp programming language is very versatile, yet quite simplistic. It is based on a list-based style data and an interpreter which understands some of said lists as programs. These programs are the basis of AI and a variety of other projects, such as, “pattern recognition, understanding textual natural language, spoken language, computer vision, medical diagnosis, automatic programming, program verification proof systems, and robot control systems” (Brooks vii). Now a very powerful programming language, it began as a chaotic compilation of dialects, but unified in 1981by the Common Lisp Committee. They were formed due to two key elements in the Lisp community: “Inconsistencies and illogical conventions from early versions” and “the existence of a complete specification of the language and a published manual ensures that programs will be transportable. Programs written in Common Lisp and debugged on one manufacture’s machine should run on another manufacture’s machine without change.” This roughly brings us to present day Lisp.
Back in 1959, Lisp began as Lisp 1.5. It was used mostly for solving symbolic algebra problems, such as finding the derivative of a function. Soon dialects of Lisp began springing up all over the place. First, there was BBN-Lisp, which was followed by Interlisp. MIT made up its own version of Lisp, which became known as Maclisp; Stanford then took Maclisp and made Lisp 1.6. Another separation occurred from 1.6 at the University of California at Irvine and at the University of Utah: UCI-Lisp and Standard Lisp respectively. However, MIT continued its development of Maclisp and came up with Lisp Machine Lisp from which, Nil, yet another dialect, is based. Franz Lisp was developed at Berkley around the same time. The Common Lisp committee is formed and the Common Lisp language is born. The Lisp programming language consists of two types of elements: atoms and lists. Atoms are form identifiers or numerical literals. Atoms are indivisible units, like the numbers 2 and 3 or the letter x. Symbols are also atoms. A symbol generally is any string of characters that exclude white space and parentheses, and includes characters that make it invalid as a number. These symbols take the place of variables and reserved words (like cout in C++). Lists are a series of symbols and/or atoms enclosed in brackets, i.e. (3 4 6 9 10). Nested lists are similar to a nested for loop in C++, i.e. (3 4 (6 9) 10) where (6 9) is a list inside the original
manipulated. Sebesta used an example where he wanted to get the sum of a list, which cannot be done using the ‘+’ symbol for the ‘+’ accepts only atoms and not lists made of atomic elements. He then shows how to read the list and calculate the sum using the atomic list. It is an interesting concept and which may have many applications. Though powerful and unique, Lisp is not good for everything. For instance, Lisp has no variables. Though Lisp is capable of doing many complicated symbolic calculations, it cannot perform any sort of iteration; all forms of loops must be done recursively. Programmers familiar with the idea of recursion know that it is not always the easiest way for a job to be done. Recursion is often slow, confusing, and often leads to a lot of trouble maintaining code. Some might say it is not hard to update a few unfamiliar recursive functions. However, imagine doing hundreds or even thousands of recursive functions that are the basis of a company’s AI project. Ideally, many of the functions would be much simpler with iteration but since Lisp does not support this, programmers are just out of luck if forced to use Lisp. Lisp is a functional programming language used primarily for programming AI and solving many varieties of symbol-based problems. It uses lists and atoms to create programs and a program written in list is in the same format as the data it manipulates, this
format is known as an S-expression. Lisp has many interesting properties such as dynamic scope and on the fly interpretation, but also has its own downfalls, such as the problem with iteration, despite this Lisp is still the one of the oldest programming languages in use today