History of Lisp
description
Transcript of History of Lisp
History of LispHistory of Lisp
And Functional Programming And Functional Programming LanguagesLanguagesScotty SmithScotty Smith
OverviewOverview
• Lambda CalculusLambda Calculus• History of LispHistory of Lisp• Key Features of Functional LanguagesKey Features of Functional Languages• HaskellHaskell• Why no one uses functional languagesWhy no one uses functional languages
Lambda CalculusLambda Calculus
• Developed by Alonzo Church in the 1930’sDeveloped by Alonzo Church in the 1930’s• Type FreeType Free• Deals with recursion, higher-order Deals with recursion, higher-order
functions, and curryingfunctions, and currying
λxλx.x+1 ≡ fun x => x+1.x+1 ≡ fun x => x+1
The Beginnings of LISPThe Beginnings of LISP
• John McCarthy -1956John McCarthy -1956• Dartmouth summer research project on Dartmouth summer research project on
Artificial Intelligence.Artificial Intelligence.• IBM 704IBM 704
FLPL: FORTRAN List Processing FLPL: FORTRAN List Processing LanguageLanguage
• Implemented at IBM by Herbert Gelernter Implemented at IBM by Herbert Gelernter and Carl Gerberichand Carl Gerberich
• Written as an extension of FORTRANWritten as an extension of FORTRAN
Conditional ExpressionsConditional Expressions
• Developed in 1957 – 1958 at MIT.Developed in 1957 – 1958 at MIT.• XIF(M,N1,N2).XIF(M,N1,N2).
• Developed a true conditional that evaluated Developed a true conditional that evaluated only one of its parameters.only one of its parameters.
Innovations Beyond FLPLInnovations Beyond FLPL
• Recursive functions using conditional Recursive functions using conditional expressionsexpressions
• MaplistMaplist
Implementation of LISPImplementation of LISP
• Fall of 1958Fall of 1958• MITMIT• Started by hand compiling functions written in Started by hand compiling functions written in
M-expressionsM-expressions• Prefix notationPrefix notation• Contains side effectsContains side effects
Turing Machines and LISPTuring Machines and LISP
• The universal LISP functionThe universal LISP function• eval[e,a]eval[e,a]
• e – The LISP expressione – The LISP expression
• a – a list of assignments of values to variablesa – a list of assignments of values to variables
The InterpreterThe Interpreter
• Written by S.R. RussellWritten by S.R. Russell
• Froze the development of the form of the Froze the development of the form of the language.language.
Moving OnMoving On
• Lisp 1.5Lisp 1.5• Insertion of elements into lists and deletionInsertion of elements into lists and deletion• Lexical scopingLexical scoping
• FUNARG deviceFUNARG device
• A compilerA compiler
Other contributions of LISPOther contributions of LISP
• Garbage collectionGarbage collection
LISP exampleLISP example
• (defun factorial (n) (defun factorial (n)
(if (<= n 1) (if (<= n 1)
1 1
(* n (factorial (- n 1))))) (* n (factorial (- n 1)))))
Key Features of Functional Key Features of Functional LanguagesLanguages
• Higher Order functionsHigher Order functions• Curried functionsCurried functions
• Lazy Evaluation (Non-strict Evaluation)Lazy Evaluation (Non-strict Evaluation)• Static typingStatic typing• Pattern MatchingPattern Matching
• GuardsGuards• fac 0 = 1fac 0 = 1
fac n|n>0 = n*fac(n-1)fac n|n>0 = n*fac(n-1)
HaskellHaskell• Purely functional languagePurely functional language• Attempt at a standard functional languageAttempt at a standard functional language• FeaturesFeatures
• Higher order functionsHigher order functions• Lazy evaluationLazy evaluation• Static polymorphic typingStatic polymorphic typing• User-defined datatypesUser-defined datatypes• Pattern matchingPattern matching• List comprehensionsList comprehensions
• New to HaskellNew to Haskell• I/O systemI/O system• OverloadingOverloading• Array comprehensionsArray comprehensions
Why no one uses functional Why no one uses functional languageslanguages
• Portability/AvailabilityPortability/Availability• TrainingTraining• PopularityPopularity
ReferencesReferences• Hudak, P. 1989. Conception, evolution, and application of functional programming Hudak, P. 1989. Conception, evolution, and application of functional programming
languages. languages. ACM Comput. Surv.ACM Comput. Surv. 21, 3 (Sep. 1989), 359-411. DOI= 21, 3 (Sep. 1989), 359-411. DOI= http://doi.acm.org/10.1145/72551.72554 http://doi.acm.org/10.1145/72551.72554
• McCarthy, J. 1978. History of Lisp. In McCarthy, J. 1978. History of Lisp. In Preprints of Proceedings of ACM SIGPLAN Preprints of Proceedings of ACM SIGPLAN History of Programming Languages Conference. History of Programming Languages Conference. SIGPLAN Notices, Vol. 13, pp. 217-SIGPLAN Notices, Vol. 13, pp. 217-223223
• Wadler, Phillip. “Functional Programming: Why no one uses functional languages” Wadler, Phillip. “Functional Programming: Why no one uses functional languages” SIGPLAN NoticesSIGPLAN Notices 33(8):23-27, August 1998. 33(8):23-27, August 1998.