Lisp (programming language): Difference between revisions

Content deleted Content added
No edit summary
mNo edit summary
Line 112:
Two [[assembly language macros]] for the [[IBM 704]] became the primitive operations for decomposing lists: [[car and cdr|car]] (''Contents of the Address part of Register'' number) and [[car and cdr|cdr]] (''Contents of the Decrement part of Register'' number),<ref name="PREHISTORY">{{cite web |title=LISP prehistory - Summer 1956 through Summer 1958 |last=McCarthy |first=John |url=http://www-formal.stanford.edu/jmc/history/lisp/node2.html |access-date=2010-03-14}}</ref> where "register" refers to [[Processor register|registers]] of the computer's [[central processing unit]] (CPU). Lisp dialects still use {{Lisp2|car}} and {{Lisp2|cdr}} ({{IPAc-en|k|ɑːr}} and {{IPAc-en|ˈ|k|ʊ|d|ər}}) for the operations that return the first item in a list and the rest of the list, respectively.
 
McCarthy published Lisp's design in a paper in ''[[Communications of the ACM]]'' inon April 1, 1960, entitled "Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I"<ref>{{cite web |last1=McCarthy |first1=John |title=Recursive functions of symbolic expressions and their computation by machine, Part I |url=https://dl.acm.org/doi/10.1145/367177.367199 |website=Association for computer machinery digital library |publisher=Association for computer machinery |access-date=28 February 2025}}</ref>.<ref name="McCarthy">{{cite web |title=Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I |last=McCarthy |first=John |url=http://www-formal.stanford.edu/jmc/recursive.html |access-date=2006-10-13 |archive-url=https://web.archive.org/web/20131004215327/http://www-formal.stanford.edu/jmc/recursive.html |archive-date=2013-10-04}}</ref> He showed that with a few simple operators and a notation for anonymous functions borrowed from Church, one can build a [[Turing completeness|Turing-complete]] language for algorithms.
 
The first complete Lisp compiler, written in Lisp, was implemented in 1962 by Tim Hart and Mike Levin at MIT, and could be compiled by simply having an existing LISP interpreter interpret the compiler code, producing [[machine code]] output able to be executed at a 40-fold improvement in speed over that of the interpreter.<ref name="Levin">{{cite web |title=AI Memo 39-The new compiler |last1=Hart |first1=Tim |last2=Levin |first2=Mike |url=ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-039.pdf |archive-url=https://web.archive.org/web/20201213195043/ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-039.pdf |archive-date=2020-12-13 |access-date=2019-03-18}}</ref> This compiler introduced the Lisp model of [[incremental compiler|incremental compilation]], in which compiled and interpreted functions can intermix freely. The language used in Hart and Levin's memo is much closer to modern Lisp style than McCarthy's earlier code.