Functional Programming Languages
Functional Programming Languages
Functional
Programming
Outline
• Introduction
• History
• Advantages and
Disadvantages
• Applications
• Example
Introducti
on
•
Functional programming is a coding style
that exhibits the following characteristics:
•
Power and flexibility
•
Simplicity
•
Suitable for parallel processing
History
•
Alonzo Church
developed
Lambda Calculus
as part of his
investigations on
Math foundations
on 1936.
History
•
Lisp (1960)
•
Hope (1970s)
•
ML (1970s)
•
Scheme (1975)
•
Miranda (1980s)
•
Haskell (1990)
Advantage
s
• Easier to design
• Easier to debug
• Can lead to more efficient programs
• Can lead to more efficient use of the
programmer’s time
• Leads to aesthetically cleaner code
• Functional languages are often interpreted
AND.
Disadvanta
ges
•
Too much recursion can overflow
the stack;
•
High memory use from creating so
many objects…
Application
s
• Computer algebra (e.g. Reduce system)
• Natural language processing
• Artificial intelligence
• Automatic theorem proving
• Algorithmic optimization of functional
programs
LET’S
TRY..
Imperative
1.Take a bread
2. Spread bread with
butter
3. Put cheese on the
bread
4. Return sandwich
Functional
Return put ( cheese, spread
(butter, bread) )
Questions?