The rise of FunctionalProgramming  A short presentation by Tjerk Wolterink
OutlineHands on1. From Imperative to Functional2. Java and LambdaTheory3. Referential Transparency4. Higher Order Function...
From Imperative toFunctional   Lets dive into code straight away!
Initial Example (dataset)
The Requirement● For all persons that are older than 20, get  the sum of those ages
Imperative Solution (Java)
Imperative Programming●   Thinks in terms of steps todo●   Time goes forward●   Mutable state●   Threads are needed to uti...
Functional Solution
Lets make it simpler
Definition of Sum
Reduction● Based on rewriting● No state
Functional Programming● Write what you want, not how to do it● Everything is a function● Stateless  ○ No side effects, rea...
Functional LanguagesFully Functional● Haskell, Lisp (from 1950!), Erlang● XSLT, Clojure (VM Based)Powerfull Functional Sup...
Java and LambaFinally Oracle got..... Hopefully
Java Lambda JSR-335"Extend the Java language to support compactlambda expressions (closures), as well asrelated language a...
Lambdas and Interfaces
Java 8 Hooray!
Theory     If Time Allows- nope time didnt allow-       Questions?
The Rise of Functional Programming
Upcoming SlideShare
Loading in …5
×

The Rise of Functional Programming

913 views

Published on

Lambda to-da-bone. No not really. Just a short introduction to those we didnt know about functional programming. Especially to java programmers.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
913
On SlideShare
0
From Embeds
0
Number of Embeds
33
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

The Rise of Functional Programming

  1. 1. The rise of FunctionalProgramming A short presentation by Tjerk Wolterink
  2. 2. OutlineHands on1. From Imperative to Functional2. Java and LambdaTheory3. Referential Transparency4. Higher Order Functions5. Lazy Evaluation6. Pattern Matching
  3. 3. From Imperative toFunctional Lets dive into code straight away!
  4. 4. Initial Example (dataset)
  5. 5. The Requirement● For all persons that are older than 20, get the sum of those ages
  6. 6. Imperative Solution (Java)
  7. 7. Imperative Programming● Thinks in terms of steps todo● Time goes forward● Mutable state● Threads are needed to utilize multiple cores● Concurrent Programming and Locking
  8. 8. Functional Solution
  9. 9. Lets make it simpler
  10. 10. Definition of Sum
  11. 11. Reduction● Based on rewriting● No state
  12. 12. Functional Programming● Write what you want, not how to do it● Everything is a function● Stateless ○ No side effects, reasoning is easier● Concurrency ○ Plays extremely nice with the rising multi-core technology ○ Execute your program in a distributed network ○ Hadoop / Map Reduce● Academia love it ○ Based on λ-Calculus and Rule Rewriting ○ Easier to prove programs correct ○ No state explosion
  13. 13. Functional LanguagesFully Functional● Haskell, Lisp (from 1950!), Erlang● XSLT, Clojure (VM Based)Powerfull Functional Support● Python, JavaScript, Scala (VM Based), Groovy (VM Based)Sort of Functional● C++ function pointers● C#● Java Lambda● Bash shell? ( ls | grep test | more)
  14. 14. Java and LambaFinally Oracle got..... Hopefully
  15. 15. Java Lambda JSR-335"Extend the Java language to support compactlambda expressions (closures), as well asrelated language and library features to enablethe Java SE APIs to use lambda expressionseffectively."
  16. 16. Lambdas and Interfaces
  17. 17. Java 8 Hooray!
  18. 18. Theory If Time Allows- nope time didnt allow- Questions?

×