History of Lisp

17
History of Lisp History of Lisp And Functional And Functional Programming Languages Programming Languages Scotty Smith Scotty Smith

description

History of Lisp. And Functional Programming Languages Scotty Smith. Overview. Lambda Calculus History of Lisp Key Features of Functional Languages Haskell Why no one uses functional languages. Lambda Calculus. Developed by Alonzo Church in the 1930’s Type Free - PowerPoint PPT Presentation

Transcript of History of Lisp

Page 1: History of Lisp

History of LispHistory of Lisp

And Functional Programming And Functional Programming LanguagesLanguagesScotty SmithScotty Smith

Page 2: History of Lisp

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

Page 3: History of Lisp

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

Page 4: History of Lisp

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

Page 5: History of Lisp

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

Page 6: History of Lisp

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.

Page 7: History of Lisp

Innovations Beyond FLPLInnovations Beyond FLPL

• Recursive functions using conditional Recursive functions using conditional expressionsexpressions

• MaplistMaplist

Page 8: History of Lisp

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

Page 9: History of Lisp

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

Page 10: History of Lisp

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.

Page 11: History of Lisp

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

Page 12: History of Lisp

Other contributions of LISPOther contributions of LISP

• Garbage collectionGarbage collection

Page 13: History of Lisp

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)))))

Page 14: History of Lisp

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)

Page 15: History of Lisp

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

Page 16: History of Lisp

Why no one uses functional Why no one uses functional languageslanguages

• Portability/AvailabilityPortability/Availability• TrainingTraining• PopularityPopularity

Page 17: History of Lisp

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.