Bashir Eghbali

                                                                                                            CSE 151

                                                                                                            Essay #1

 

Topic: What special needs does AI have of a programming
language? What language do you think best accomplishes these objectives?

 

Since practical advancements in Artificial Intelligence were limited to the low performance level of existing computers up to about 1990s, we know that speed is one of the most important needs of Artificial Intelligence from computers and programming languages. Of course speed is not the only factor otherwise we would have written all of our programs in assembly. Lisp is a very powerful functional language that provides a very fast development environment. The read-eval-print construct of Lisp offers fast compilation and building of programs. Peter Norvig has an interesting article on the efficiency of languages and their relative speed to each other.

Artificial Intelligence (AI) is primarily based on learning and processing information obtained from the environment surrounding the intelligent agent. This processing often includes a series of searches in the input space that demands a programming language in which it is easy to write search algorithms. I think that Lisp provides a very compact and easy way of writing functions and search algorithms. Prolog is also another language and satisfies this requirement but according to Peter Norvig and Stuart Russell in “Artificial Intelligence, a modern approach”, Prolog uses depth first search for solving problems and there is a possibility of it failing to return from an infinite path created by circular sentences.

Because of the rapid developments and advances in the field of AI, it would be very beneficial to have languages that are platform independent and can be run on any operating system and with any device. Java’s byte code convention certainly alleviates that problem and gives portability to codes. In a few years when interactive robots and devices need to interact with each other and give and receive files and instructions, a platform independent language is almost inevitable.

Since AI programs can get very lengthy and complicated, a good programming language for AI must have good debugging tools and less room for making mistakes. Languages like C or C++ where you need to dynamically allocate memory and make sure that declarations and types match, there is more room for making errors. In Lisp, the garbage collector and the static memory allocation and node creation makes the job of the AI programmer a lot easier and the development faster. The debugging system for Lisp is very powerful and can be used to detect many errors. Since Lisp interpreter does not generate segmentation faults it is much easier to have a more reliable program that will not terminate abruptly. (Norvig, Peter : Python for Lisp Programmers)

Additionally, in Lisp, not distinguishing between types makes it more efficient and faster and leaves less room for incompatibility and errors. Also the use of linked lists whose elements are connected by pointers make lisp structures more flexible as opposed to arrays in empirical languages such as C.(Norvig, Peter; Russel, Stuart; Artificial Intelligence 329).

The tendency of Lisp programs to be modularized and compact makes them very readable, reusable and easy to understand. Also, the mathematical formalism of inductive reasoning and predicate logic that are in wide use in the AI world are easy to implement in Lisp because of its symbolic manipulation tools and predicate-based logic (McCarthy, John; Programs with common sense).

Even though Lisp is not a perfect language for AI, it seems to be the best option for many applications in AI. Since there are not standardized libraries for Lisp and since it is platform dependent, its reach is limited. However many of its powerful concepts such as the garbage collector, the linked-list representation in memory, compactness and reusability, fast building and friendly debugging systems, its symbolic data representation and manipulation and its modularity effectiveness make it a very good choice of development language in Artificial Intelligence.