Essay #1: What makes a Language Good for AI?

by Jennifer Bowen

The needs of artificial intelligence

While there are many approaches to artificial intelligence, the approach that is easiest to study and will thus benefit us the most is the study of rational agents, or constructs capable of perceiving and acting. The study of agents that act rationally is also a more general approach, because it does not require all thinking to be inference-based (Russel & Norvig, 7-8). We will not consider neural networks to play a part in this discussion, largely because the needs of a neural network architecture are so different from those of a more traditional symbol-processing approach.

Progammers developing rational agents seek a number of features in the language they use, including the following:

  • The ability to maintain data structures to represent internal states. (Russell & Norvig, 339)
  • Interactivity. Interactive languages are capable of quickly responding to modifications.
  • (Russell & Norvig, 18)
  • The ability to take care of low-level details behind the scene, including garbage collection and dynamic variable typing.
  • Ability to handle a variety of input data types.
  • Modularity, especially through object-oriented programming.
  • Flexibility.
  • Documentation.
  • Languages for artificial intelligence

    Prolog

    Prolog remains a popular language around the world, despite a number of flaws. Prolog uses declarative programming and horn-clause logic to derive behavior. Lambda Prolog is a derivative of the Prolog language that offers added functionality. Prolog is useful for goal-directed search but fails to offer enough flexibility to be indispensible as a symbolic programming language.

    C++

    C++ is an enormously popular, powerful object-oriented language that is poorly suited to symbol proccessing due to its procedural roots, yet remains widely used in spite of this. While C++ is modular and extremely flexible, it is also a compiled language and thus changes are made to the agent much less easily. C++ also leaves far too much of the implementation details to the programmer. No automatic garbage collection, no dynamic typing, and no automatic memory allocation or predefined list types. While all of these may be made available through additional libraries, they are not a part of the standard C++ programmer's existence. C++ is a poor compromise for the AI programmer.

    Kiev

    Kiev is a Java extention that adds logic-programming functionality to the Java programming language. While Java inherits many of the problems from its predecessor C++ (procedurally-based, complexity, etc.), it corrects many of its flaws by implementing such features as automatic garbage collection. As a new language in the field, relatively few online resources exist to help the Java AI programmer. Kiev also offers a GUI display environment for better demonstration of AI behavior. Unfortunately, little online documentation is available for Kiev, making this as yet an undesirable language to program in.

    Python

    Python is an interpretive, object-oriented language derived from Lisp. As such, it is an excellent tool for fast prototyping and suffers from relatively few flaws (namely speed and lack of good compile-time error analysis). It also has a number of extra features that few languages can boast, such as standard GUI and web libraries, and a version that is seemlessly integrated into the Java environment (JPython). Python is possibly the only language to fulfill all of the aforementioned needs of the AI programmer, including interactivity, the use of lists as a data type, native object-orientation, and dynamic typing. As a derivative of Lisp, a great deal of documentation is available for Python online.

    For further information on the use of programming languages for artificial intelligence, see PC AI's guide to AI languages.


    References
    Russell, Stuart, and Norvig, Peter: Artificial Intelligence, A Modern Approach. Prentice Hall: New Jersey, 1995.