Abadeh

Lisp is the most former family of imperative languages and functional. Initially developed as a practical model to represent programs (by contrast with the theoretical concept of Machine of Turing), it became in the Seventies and Eighties the language of choice for research in Artificial intelligence. The Lisp languages are used today in many fields, programming Web with the Finance, and in the courses of training in Data processing.

The term Lisp was forged starting from English “list processing”. All the dialects of Lisp divide the same operators of handling of simple chained lists. Lisp is characterized moreover by a simple syntax in prefixed Notation, its dynamic Typage of the data, the support for the functional Programmation, its automatic management of the memory and faculty to handle the source code as a structure of data.

The Lisp languages are recognizable immediately with their appearance. The Source code of the programs is written by using same syntax as that of the lists - the parenthésée syntax of the S-expression S. Each under-expression of a program (or structure of data) is delimited by brackets. That simplifies the syntactic Analyze largely Lisp programs and makes simple the Métaprogrammation -- the creation of programs which create other programs.

If one excludes the machine language and the assembly language (or more commonly “assembler”), Lisp is the second oldest language (just after FORTRAN) among the languages which were widely diffused. Lisp evolved/moved much since the beginning of the Années 1960 and thus gave rise to many dialects.

History

The Lisp language was invented by John McCarthy in 1958 whereas it was with the Massachusetts Institute off Technology (MIT). It off published an article entitled “Recursive Functions Symbolic Expressions and Their Computation by Machine, Part I” (that is to say “Recursive Functions of expressions symbolic systems and their evaluation by a Machine, part I”) in the review CACM in 1960; part II was never published.

The first interpreter functioned on a computer IBM 704 and two instructions of this machine became the two primitive operations of Lisp to break up the lists:

  • because (Content off Address register): the first element of the list
  • cdr (Content off Decrement register): the remainder of the list

Into its article, John McCarthy introduces two syntaxes: the S-expression S (expressions symbolic systems, sometimes called “sexp”) and the Mr.-expressions (méta-expressions allowing l´ Homoiconicité to express the functions handling of the S-expressions). The Mr.-expressions never were very appreciated and the majority of Lisps nowadays use S-expressions for the programs as for the data. It is the syntax of the S-expressions which makes that some reproach Lisp for being “full with brackets”, but it is also one of the sources of the power and the flexibility of the language. This profusion of brackets made call LISP: Batches off Insipid and Stupid Brackets (of heaps of the insipid and stupid brackets or, in French Idiotic Language Saturated with Brackets ).

Probably because of its expressivity and its flexibility, Lisp had much success in the community of the Artificial intelligence. In the Years 1970, one created computers specialized in the execution of Lisp programs: the machines Lisp.

During the Years 1980 and 1990, one made main efforts to unify the many dialects of Lisp which had appeared. The result was called Common Lisp and in 1994, ANSI published “ANSI X3.226-1994 Information Technology Programming Language Common Lisp”, thus standardizing the language. At this time, Lisp was much less flourishing than at its great time.

Although eclipsed by languages close to the machine (C, C++) or supported by aggressive campaigns marketing, Lisp remains a language very much used, in particular as a language embarked in applications, where it is used as language of extension. The most known case of embarked use of Lisp is the text editor Emacs. It will be noted in addition that Lisp comes in fourth position in terms from lines from codes used to implement the 8.600 packages sources available in the operating system Debian published in June 2005. The first eight languages are distributed as follows: C (57%), C++ (16.8%), Shell (9%), LISP (3%), Perl (2.8%), Python (1.8%), Java (1.6%), FORTRAN (1.2%).

Syntax

The lists are delimited by brackets and their elements are separated by spaces: (1 2 " foo"). A Lisp program is a Arbre of syntax composed with lists. This use of the brackets gives place to mockeries on the name of LISP: “Batches off Irritating and Silly Brackets”, or “Batches off Stupid and Insipid Parentheses” (which one could respectively translate by: “Language unnecessarily and stupidly bracket” and “Of heaps of the stupid and insipid brackets”).

Lisp is a language directed expression: it does not make distinction between “expressions” and “statements” (instructions) as do it many language (for example Pascal); all is expression and turns over a value or a whole of values.

The majority of the Lisp expressions are applications of function. What other languages write f (has, B, c) Lisp writes it (F has B c) Thus a sum is not noted 1+2+3+4 nor somme (1,2,3,4) but (+ 1 2 3 4) One uses the same notation prefixed for the “special forms” and the “macros”: the first element in the list, in these cases, determines how the following elements will be treated. An expression can be an application of function, a special form or an application of macro following the nature of the first element.

Examples

The following programs are not typical truths Lisp programs. They are typical presentation which one makes of Lisp in the computer courses.

The factorial is a great classic: (defun factorial (N) “The factorial of entirety N Calculates. ” (yew (<= N 1) 1 (* N (factorial (- N 1)))))

One can also write more effectively (see final Récursion): (defun factorial (N &optional (acc 1)) “Compute the factorial off the integer N. ” (yew (<= N 1) acc (factorial (- N 1) (* acc N))))

Another typical example is this function which reverses a list (Lisp has an integrated function reverse for this purpose): (defun reverse (L &optional (acc '())) “shift the list L” (yew (no L) acc (reverse (cdr L) (idiots (because L) acc))))

Lisp and Objects

Various systems with objects were built starting from Lisp, in particular:

  • Flavors, conceived with the MIT
  • Common Lisp Object System (CLOSED), a descendant of Flavors

CLOSED offers multiple Héritage, the multiple selection and a powerful system of combination of methods. Common Lisp (of which CLOSED forms part) was the first language standardized direct-object.

Quotation

Grégory Chaitin on Lisp:

“Unfortunately, whereas the computer programming languages gain in sophistication, they are more and more the reflection of the complexity of the human society and the immense world of the software applications. Thus, they become enormous toolboxes, like garages and attics charged of more than thirty years of history! A contrario, LISP is a computer programming language of a great mathematical beauty; it resembles more one scalpel of surgeon or a diamond sharpened that with a garage in two places encumbered of do-it-yourself, where there does not remain any more place for a car.

LISP has a small number of powerful concepts elementary, and all the remainder is built above that, which corresponds the made-to-order to work of the mathematicians; it is with that resemble the mathematical theories. These theories, the good theories, consist in defining some new key concepts, and starting from there the fireworks starts: they reveal new alleys, they open the door in radically new worlds. LISP is like that too; it is closer to the maths than the majority of the computer programming languages. At least if you eliminate the useful parts which were added, the additions which made LISP a practical tool . What remains if you made that, it is the original LISP, the conceptual heart of LISP, a heart which is a mathematical jewel of beauty and austere intellectual beauty.”

Today, some would say that Scheme is the derivative of Lisp reaching with the beauty described by Chaitin; and it is certain that Common Lisp, the descendant in straight line of the great vintages of the last dialects of LISP (Maclisp, Interlisp, Zetalisp) leans more on the side of the toolbox giant , although having preserved intact its conceptual heart.

G. Chaitin used this Lisp idealized for its research: Elegant LISP Programs.

Genealogy and Alternatives

  • LISP (the original version of John McCarthy when it was with the MIT)

  • MACLisp (related to project MACSYMA of the MIT - and without bond with Apple Macintosh), direct descendant of LISP
  • ZetaLisp, successor of MACLisp, it functioned on machines LISP
  • InterLisp, born BBN Lisp, which was used to develop the first user interfaces graphic,
  • LeLisp (or Le-Lisp), French version of the famous language, developed with INRIA, and marketed then by Ilog
  • EuLisp, “Lisp Européen”
  • ELISP (Emacs Lisp), simplified version used to program the text editor Emacs
  • AutoLISP, a LISP used in AutoCAD for the programming.
  • Design, a LISP purified
  • Nyquist, a LISP used to work with sounds.
  • XLispStat, a LISP used for the statistical analyzes of data.
  • XLisp, a subset of the Lisp language developed by David Michael Betz
  • QLisp, an extension of Xlisp4.3 with a hundred routines of analysis of images
  • RPL (Reverse Polish lisp), a derivative used on the computers HP

Notes and references of the article

Random links:List minerals (letter D) | Sistema de comunicación total del acceso | Tarentola mindiae | Buffy against the vampires: Bleeds chaos | Hsintien | National federation of tourism