SlideShare a Scribd company logo
The rise of Functional
Programming




  A short presentation by Tjerk Wolterink
Outline
Hands on
1. From Imperative to Functional
2. Java and Lambda
Theory
3. Referential Transparency
4. Higher Order Functions
5. Lazy Evaluation
6. Pattern Matching
From Imperative to
Functional
   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 utilize multiple cores
●   Concurrent Programming and Locking
Functional Solution
The Rise of Functional Programming
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, 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
Functional Languages
Fully 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)
Java and Lamba
Finally Oracle got..... Hopefully
Java Lambda JSR-335
"Extend the Java language to support compact
lambda expressions (closures), as well as
related language and library features to enable
the Java SE APIs to use lambda expressions
effectively."
Lambdas and Interfaces
Java 8 Hooray!
Theory
     If Time Allows
- nope time didn't allow-
       Questions?

More Related Content

PDF
Kotlin & arrow: the functional way
PDF
Thinking Functionally
PDF
Kotlin & Arrow the functional way
PPTX
Introduction to functional programming, with Elixir
PDF
Clojure presentation
PPTX
LINQ/PLINQ
PDF
Sprint Boot & Kotlin - Meetup.pdf
ODP
Review june2014 june2015
Kotlin & arrow: the functional way
Thinking Functionally
Kotlin & Arrow the functional way
Introduction to functional programming, with Elixir
Clojure presentation
LINQ/PLINQ
Sprint Boot & Kotlin - Meetup.pdf
Review june2014 june2015

What's hot (19)

PDF
Functional programming
PPTX
Introduction to Functional Programming and Clojure
ODP
Elixir otp-basics
ODP
Devoxx 2013 Summary/Keynotes
PPTX
Introduction to Reactjs
PPTX
Modern Programming Languages - An overview
PDF
Oleksii Pedorenko and Dmytro Melnychuk "DAO Project Experience"
PPTX
ODP
Concurrent programming
PPTX
Functional programming ideas in python
PPTX
PPTX
PPTX
PDF
Introduction to Kotlin coroutines
PPTX
Green Custard Friday Talk 5: React-Native Performance
PPTX
PL/pgSQL - An Introduction on Using Imperative Programming in PostgreSQL
PPTX
Gdg dev fest 2107 to kotlin, with love
PPT
Imperative and-functional-programming
PPT
Intro dotnet
Functional programming
Introduction to Functional Programming and Clojure
Elixir otp-basics
Devoxx 2013 Summary/Keynotes
Introduction to Reactjs
Modern Programming Languages - An overview
Oleksii Pedorenko and Dmytro Melnychuk "DAO Project Experience"
Concurrent programming
Functional programming ideas in python
Introduction to Kotlin coroutines
Green Custard Friday Talk 5: React-Native Performance
PL/pgSQL - An Introduction on Using Imperative Programming in PostgreSQL
Gdg dev fest 2107 to kotlin, with love
Imperative and-functional-programming
Intro dotnet
Ad

Similar to The Rise of Functional Programming (20)

PDF
Reactive Software Systems
PDF
Java 8 features
PDF
Introduction to Clojure
KEY
Java Closures
PDF
Why Functional Programming and Clojure - LightningTalk
PPTX
Scala-Ls1
KEY
Polyglot and Functional Programming (OSCON 2012)
PDF
Guglielmo iozzia - Google I/O extended dublin 2018
PDF
Unit 1 Core Java for Compter Science 3rd
PPTX
Java programming language
PDF
I know Java, why should I consider Clojure?
PPTX
Introduction to Scala
PDF
Clojure in real life 17.10.2014
KEY
Polyglot and functional (Devoxx Nov/2011)
PDF
Building Asynchronous Applications
PDF
Are High Level Programming Languages for Multicore and Safety Critical Conver...
PPTX
PARADIGM IT.pptx
PPTX
Scala final ppt vinay
PDF
FregeDay: Design and Implementation of the language (Ingo Wechsung)
PPTX
Spark - The Ultimate Scala Collections by Martin Odersky
Reactive Software Systems
Java 8 features
Introduction to Clojure
Java Closures
Why Functional Programming and Clojure - LightningTalk
Scala-Ls1
Polyglot and Functional Programming (OSCON 2012)
Guglielmo iozzia - Google I/O extended dublin 2018
Unit 1 Core Java for Compter Science 3rd
Java programming language
I know Java, why should I consider Clojure?
Introduction to Scala
Clojure in real life 17.10.2014
Polyglot and functional (Devoxx Nov/2011)
Building Asynchronous Applications
Are High Level Programming Languages for Multicore and Safety Critical Conver...
PARADIGM IT.pptx
Scala final ppt vinay
FregeDay: Design and Implementation of the language (Ingo Wechsung)
Spark - The Ultimate Scala Collections by Martin Odersky
Ad

The Rise of Functional Programming