Lisp - the artificial intellect programming language

  Computers were originally developed for realisation of numerical calculations and processing of great volumes of data. Performance of the big number of algorithms or complex is peculiar to numerical calculations, but in advance precisely certain calculations over rather simple monotonous elements given - numbers, vectors, files, etc. The most effective supercomputers are capable to carry out discouraging quantity of operations in a second. Numerical calculations well suit for the decision of scientific and technical problems, their concepts quantitatively mensurable and is exact representable in the numerical form.
  In turn in economic problems the considerable quantity of the data consisting often from elements of given various types which, however, are regular under the form is processed and files and databases concern quantitative types of data, such, for example, as records. Carried out actions are rather simple, but programs can be great enough.

Symbolical processing

  The computers focused on the decision described above problems, and programming languages do not suit so well for symbolical processing which deals with complex structures of data and the knowledge bases containing rules of decision-making and other diverse objects. Symbolical processing allows to work effectively with such structures as the offer of a natural language, a word meaning and offers, indistinct concepts etc., and on their basis to make of the decision, to lead reasonings and to carry out other ways of the manipulation peculiar to the person with data. As a typical example serve the expert systems containing a professional knowledge on some speciality, the programs working with a natural language etc.
  In these applications representation in the suitable form symbolical and given with complex structure is supposed. Work with them is often conducted in in advance unpredictable situations. It is characteristic, that except complex structure a variety of forms of their expression is peculiar to such data. The most part of objects of data of concrete problem area can have an individual structure distinct from others. However at their processing the behaviour of the program is defined on the basis of principles set at more general level, laws and rules, and also on the basis of types of situations and the samples recognised in these situations.
  For example, in the program playing chess it is impossible to consider all positions in advance. The game analysis is carried out on the basis of classification of positions, recognition of standard positions, definition of characteristics of positions, construction of estimations of a current position and use of the limited set of strategy, decision-making rules etc. So the program can estimate such positions which the programmer specially did not provide. At successful coincidence of circumstances the program can win the founder.
  By means of the structures having set of forms of representation, began possible to solve problems which were considered earlier practically or even essentially unsoluble. The greatest restrictions in creation of reasonable programs are imposed by insufficient knowledge us of mechanisms of decision-making, a structure of knowledge of a natural language and about other areas, and also level of our skill in programming.

Lisp has outstripped time

  The Lisp is the most important programming language used in researches on an artificial intellect and in mathematical linguistics. The name of language "Lisp" occurs from "list processing". Literally english word "lisp" means to "murmur". As a name of the programming language of an artificial intellect it neatly as by means of a Lisp computers have learnt to murmur to a certain extent in human language.
  And still the Lisp in any sense is not the baby. More likely it the old man among programming languages. A Lisp it is developed already in the fifties and is after the Fortran the oldest still the used programming language. But unlike the Fortran the Lisp future still ahead.
  The Lisp represents language of so-called functional programming. It is based on algebra of list structures, ljambda-calculation and the theory of recursive functions. Thanks to backwardness of the traditional computer facilities, character differing from another programming languages and because of presence of elementary means of processing of lists a Lisp long time was the basic tool of researchers of an artificial intellect and means of the theoretical approach to the programming analysis. However in the eighties a Lisp, at last, left laboratories and has found application in applied problems.
  Usually programming languages do not invent, but project. However in relation to a Lisp it is possible to speak about the invention. The initial version of language, in particular, contained set of concepts and principles which at first seemed very strange, but many of which have appeared an essential innovation later. Besides, addition possibility in a Lisp within decades of many new lines has confirmed property of expansibility of this language. Round a Lisp there was the wide culture covering numerous schools and various dialects of language, various systems and programming methods, program environments and the Lisp-machine.
  Further we will shortly examine numerous properties of a Lisp and its difference from other programming languages.

The identical form of the data and the program

  In a Lisp of the form of representation of the program and data processed by it are identical. Both that and another is represented the list structure having the identical form. Thus programs can process and transform other programs and even themselves. In the course of translation the expression entered and generated as a result of calculations given to interpret as the program is possible and directly to execute. The possibility of the so-called programming operated data given to it, and direct influence of the program on the program are closely connected among themselves.
  This property possesses not only theoretical, but also the big practical value. Uniformity of data presentation and the program it is possible to compare with a principle of Fon Neumann on which the program and data are stored in uniform memory . Thanks to it there was a magnificent possibility of creation of the universal computer of data processing. Accordingly uniform representation of the program and data and realisation of the program by interpretation is opened by absolutely new possibilities of programming.
  Universal uniform and simple syntax of the list does not depend on application, and with its help it is easy to define new forms of record, representation and abstraction. Even the structure of language is, thus, expanded and can be anew defined. At the same time it is simple enough a spelling of interpreters, compilers, converters, editors and other means. To a Lisp it is necessary to approach as to the programming language with which help the specialised languages focused on the appendix are realised, and the environment of higher level is created. Flexible expansibility inherent in a Lisp does not meet in the traditional closed programming languages.

The data storage which is not dependent on a place

  The lists representing the programs and data, consist of list cells, the arrangement and which order in memory are insignificant. The list structure is defined logically on the basis of names of symbols and indexes. Addition of new elements in the list or removal from the list can be made without carrying over of the list to other cells of memory. Reservation and clearing can depending on requirement dynamically be carried out, a cell behind a cell. Business In another way is, for example, at the manipulation with strings or arrays of Fortran.

Automatic and dynamic handle of memory

  The user should not cares of the memory account. The system reserves and releases memory automatically according to requirement. When memory comes to an end, the special ashman is started. It collects not used symbols and lists, puts them into operation by secondary use. The Lisp environment constantly is kept in order. Control of memory simply also does not depend on a physical arrangement as free memory logically consists of a chain of list cells.
  First of all data are processed in operative and virtual memory which can be enough big. Files are used basically for storage of programs and data in an interval between sessions.

Functional mentality

  So-called functional programming used in a Lisp is based on that simple idea, that as a result of each action there is a value. Values become arguments of following actions, and the end result of all problem stands out to the user.
  Programs are under construction of logically dismembered definitions of functions. Definitions consist of operating structures which will organise calculations and from enclosed, often causing itself (recursive) calls of functions. The basic means of functional programming just also are a composition and recursion.

Possibility of various methods of programming

  Except functional programming in a Lisp it is possible to use the programming based on usual by turns execution of operators with assignment, transfers of control and special operators of a cycle. By means of macroprogramming it is possible to program new structures of language or to realise absolutely modern languages. Besides, in a Lisp it is possible to apply set of methods of the programming known from traditional languages. Depending on system in a Lisp it is possible to use methods of programming of higher level for example such, as object-oriented programming, situational programming, productional programming and logic programming. Various methods can be applied in common in the uniform integrated environment.

Step-by-step programming

  Programming and program testing is carried out function behind function which by turns are defined and exposed to testing. Such approach name step-by-step programming. The writing, testing and program correction is carried out in Lisp-system without intermediate use of operational system. Special operational systems more are not used, they are more exact are hidden from the user. All services are available in the integrated programming system.
  The auxiliary means, at the disposal of the user, such as, for example the editor, the inspector, the compiler, the structural press and others form the general integrated environment which language cannot be distinguished from system means accurately. Separate means by the principle are transparent that other means could use them. For example, the editor can cause the interpreter. The editor - the interpreter and so on even recursively. Work can is made often at various levels or in various working windows. Such mode of work especially well suits for research programming and fast construction of prototypes.

Lisp - the programming language without fastening of types

  In a Lisp names of symbols, variable, lists, functions and other objects are not fixed preliminary to any types of data. Types in general are not connected with names of objects of data, and accompany objects. Thus, variables can represent various objects to the various moments of time. In this sense the Lisp is language without fastening of types.
  For example, in the Fortran names of the variables beginning with letters I, J and K, are fixed to integers already from the moment of language definition in the fifties. In Pascal the variable type is fixed at a stage of a writing of the program. In some languages the variable type is defined at a translation stage. In a Lisp the type is defined on a course of performance of the program.
  Dynamic, carried out only in the course of execution, check of type and later linkage suppose versatile use of symbols and flexible updating of programs. Functions can be defined practically irrespective of types of data to which they are applied.
  However specified not-fixedness types does not mean, that in a Lisp at all there are no given various types. We will see further, that the set of types of the given most developed Lisp-systems is extraordinary various.
  Free inclusion in language of new possibilities and structures if was considered was one of the general principles of development of Lisp-systems, that they will find wider application. It was possible in connection with natural expansibility of language.
  Payment for dynamic types are actions on type check at an execution stage. In the Lisp-machines type check is effectively carried out at equipment level.

The uniform system and applied programming language

  The Lisp is simultaneously as language applied, and system programming. It reminds a computer language to that both data, and the program are presented in the identical form. Language excellently suits for a writing of interpreters and compilers both for it, and for other languages. For example, the kernel of the interpreter of the Lisp, written on the Lisp, makes pair of pages of a beautiful code. Approximately in the same volume the kernel of the interpreter of the Prologue will go in also. As is known, the shortest interpreter of the Prologue written on a Lisp occupies some tens lines.
  Traditionally Lisp-system in the basic part is written on a Lisp. At programming, for example the compiler, there is a possibility for optimisation of an objective code to use complex transformations and artificial intellect methods. The Lisp is possible in good sense to consider as language of machine and system programming of high level. And it is especially characteristic for the Lisp-machines which equipments up to level are designed for a Lisp and which system software is written on a Lisp.

The integrated environment of programming

  Lisp-system and programming environments develops already since the end of 50th years. From the very beginning of working out in them the principle of possibility of use of separate means directly from the interpreter has been put.
  In realisations for the microcomputer the quantity of the system and built in functions usually is limited to order of ten, hundreds. In the big systems of division of time, such as MacLisp and InterLisp, functions many hundreds. The CommonLisp and the automated workplaces (workstations) for researchers of an artificial intellect and the Lisp-machine offer especially wide choice of various auxiliary means and functions of the integrated environment which, among other things, is open for updatings of the user.
  The system software of the Lisp-machines contains more than 10000 functions and ten mbytes of a code. In many systems initial texts of a code a Lisp are given to the user. System functions can be redefined or modified, and the user can freely expand and adjust system for itself.

Widespread errors and prejudices

  About a Lisp say, that it is inefficient language, especially regarding arithmetics. It was true at the initial stage. The attention as language has been intended for symbolical processing was not paid to the numerical side. Now it any more so. Lisp-system can be in numerical calculations more effective, than the Fortran by the same machine. It speaks including that in compilers from a Lisp it is possible to apply more complex transformations to code optimisation.
  That the big systems offering multilateral and reasonable services, demand the big computing capacity is natural and are bulky for system of division of time. However it is connected not with a Lisp or its bad realisation, and with that attention and with that readiness to help which the system offers the user.
  For example, InterLisp keeps the full list of all actions of the user and the full description of earlier conditions of system and it is capable to correct automatically many discrepancies, as, for example, mistakes in a writing. If these properties correctly to use, they increase productivity of the professional programmer in larger degrees, than spend machine resources.
  From the point of view of programming the external shape of language is exposed to the criticism also: abundance of brackets and the seeming disorder. The Lisp ("Lots if Idiotic Silly Parentheses") is represented as is difficult-understood and studied language.
  Such approach results from used in a Lisp of a functional mentality and technics of programming which are alien to the programmers who have got used to operational programming of traditional languages. Naturally used in programming on a Lisp of structure of data and operating structures are often complex, as problems of an artificial intellect because of the complexity assume complex structures and programs. Hierarchical list structures and a Lisp just also reflected for work with challenges. Artificial simplification of structures would mean neglect the valid complexity of problems.
  Idea of a Lisp is attempt to simplify the problem decision, structuring used data and simplifying programs. Such approach has appeared useful, for example, in object-oriented programming and in expert systems. These areas contain more amount of knowledge with complex structure which are interpreted by often enough simple procedures of search and decision-making.

Simple and effective language

  The structure of language a Lisp is simple and consecutive. Lisp function can print in clearly structured and well readable kind. In many systems there is a possibility of use of the form of record with small quantity of brackets and close by the form to more traditional languages.
  The good proof of simplicity of use of a Lisp is its wide application in research works on programming of complex methods of processing of knowledge. The most part of significant programs of an artificial intellect is programmed on a Lisp or in the language of higher level founded on it. By results of some researches it is possible to reach, say, in the environment of Lisp-machine programming increases of productivity of programming in some tens times in comparison, for example, with programming on Cobol.