© 1999-2017 Erlang Solutions Ltd
Concurrent Languages are

Functional
Francesco Cesarini
Founder & Technical Director @ Erlang Solutions
@FrancescoC
francesco@erlang-solutions.com
© 1999-2017 Erlang Solutions Ltd 2Source: Warner Bros
© 1999-2017 Erlang Solutions Ltd
Two ways to do 

concurrency
3
Mutable State Immutable State
Msg
© 1999-2017 Erlang Solutions Ltd
© 1999-2017 Erlang Solutions Ltd 4
© 1999-2017 Erlang Solutions Ltd
Y = X2-1
Immutability
© 1999-2017 Erlang Solutions Ltd
Mutability
X = X2-1
© 1999-2017 Erlang Solutions Ltd
Mutability
X = X2-1
© 1999-2017 Erlang Solutions Ltd 8
Corrupt State

With Mutability
© 1999-2017 Erlang Solutions Ltd 9
Corrupt State

With Mutability
© 1999-2017 Erlang Solutions Ltd 1
0
Corrupt State

With Mutability
© 1999-2017 Erlang Solutions Ltd 11
Locality

With Mutability
Bangalore,
India
London,
UK
© 1999-2017 Erlang Solutions Ltd
Connectivity

With Mutability
12
Bangalore,
India
London,
UK
© 1999-2017 Erlang Solutions Ltd 13
Corrupt State

With Immutability
© 1999-2017 Erlang Solutions Ltd 14
Corrupt State

With Immutability
© 1999-2017 Erlang Solutions Ltd 15
Corrupt State

With Immutability
© 1999-2017 Erlang Solutions Ltd 1
6
Locality

With Immutability
Bangalore,
India
London,
UK
© 1999-2017 Erlang Solutions Ltd 1
7
Connectivity

With Immutability
Bangalore,
India
London,
UK
© 1999-2017 Erlang Solutions Ltd
Shared Memory
18
No Shared Memory
Msg
© 1999-2017 Erlang Solutions Ltd
Two ways to do
concurrency
© 1999-2017 Erlang Solutions Ltd
© 1999-2017 Erlang Solutions Ltd
Source: Serious Eats
© 1999-2017 Erlang Solutions Ltd 21
Distribution
© 1999-2017 Erlang Solutions Ltd 22
Lambdas & Closures
double([H|T]) ->
[H*2|double(T)];
double([]) ->
[].
bump([H|T]) ->
[H+1 | bump(T)];
bump([]) ->
[].
map(Fun, [H|T]) ->
[Fun(H)|map(Fun,T)];
map(_Fun, []) ->
[].
double(L) ->
map(fun(X)-> X*2 end,L).
bump(L) ->
map(fun(X)-> X+1 end,L).
© 1999-2017 Erlang Solutions Ltd 23
Parallella Board
Dual core ARM processor + Epiphany
16/64 core co-processor, FPGA
Raspberry Pi 2
Quad core ARM processor, GPU
© 1999-2017 Erlang Solutions Ltd
From Embedded 

Devices…
© 1999-2017 Erlang Solutions Ltd© 1999-2017 Erlang Solutions Ltd 24
●  93 petaflops/s (November 2016)
●  40,960 Nodes, each with 2 Ivy Bridge
multicores and 3 Xeon Phis
●  3,120,000 x86 cores in total
Sunway TaihuLight
Chinese National University of
Defence Technology
To the Fastest 

Computer in the 

World!
© 1999-2017 Erlang Solutions Ltd 25
© 1999-2017 Erlang Solutions Ltd
Concurrency + Distribution
Immutability Concurrency Distribution
© 1999-2017 Erlang Solutions Ltd
Concurrency + Distribution
Immutability Concurrency Distribution
Multi-core Parallelism
© 1999-2017 Erlang Solutions Ltd
Concurrency + Distribution
Immutability Concurrency Distribution
Multi-core Parallelism
Scalability
Reliability
© 1999-2017 Erlang Solutions Ltd
Distribution
Bangalore,
India
London,
UK
© 1999-2017 Erlang Solutions Ltd
Distribution
Bangalore,
India
London,
UK
© 1999-2017 Erlang Solutions Ltd
Distribution
Synchronous
Asynchronous
At the Most Once
Exactly Once
At Least Once
Sequential
Parallel
© 1999-2017 Erlang Solutions Ltd 32
© 1999-2017 Erlang Solutions Ltd 33
“Programming consists of overcoming two things:
accidental difficulties, things which are difficult
because you happen to be using inadequate
programming tools, and things which are
actually difficult, which no programming tool or
language is going to solve.”
- Joel Spolsky
Questions?
© 1999-2017 Erlang Solutions Ltd
Francesco Cesarini
Founder & Technical Director @ Erlang Solutions
@FrancescoC
francesco@erlang-solutions.com

Concurrent languages are Functional by Francesco Cesarini

  • 1.
    © 1999-2017 ErlangSolutions Ltd Concurrent Languages are
 Functional Francesco Cesarini Founder & Technical Director @ Erlang Solutions @FrancescoC francesco@erlang-solutions.com
  • 2.
    © 1999-2017 ErlangSolutions Ltd 2Source: Warner Bros
  • 3.
    © 1999-2017 ErlangSolutions Ltd Two ways to do 
 concurrency 3 Mutable State Immutable State Msg © 1999-2017 Erlang Solutions Ltd
  • 4.
    © 1999-2017 ErlangSolutions Ltd 4
  • 5.
    © 1999-2017 ErlangSolutions Ltd Y = X2-1 Immutability
  • 6.
    © 1999-2017 ErlangSolutions Ltd Mutability X = X2-1
  • 7.
    © 1999-2017 ErlangSolutions Ltd Mutability X = X2-1
  • 8.
    © 1999-2017 ErlangSolutions Ltd 8 Corrupt State
 With Mutability
  • 9.
    © 1999-2017 ErlangSolutions Ltd 9 Corrupt State
 With Mutability
  • 10.
    © 1999-2017 ErlangSolutions Ltd 1 0 Corrupt State
 With Mutability
  • 11.
    © 1999-2017 ErlangSolutions Ltd 11 Locality
 With Mutability Bangalore, India London, UK
  • 12.
    © 1999-2017 ErlangSolutions Ltd Connectivity
 With Mutability 12 Bangalore, India London, UK
  • 13.
    © 1999-2017 ErlangSolutions Ltd 13 Corrupt State
 With Immutability
  • 14.
    © 1999-2017 ErlangSolutions Ltd 14 Corrupt State
 With Immutability
  • 15.
    © 1999-2017 ErlangSolutions Ltd 15 Corrupt State
 With Immutability
  • 16.
    © 1999-2017 ErlangSolutions Ltd 1 6 Locality
 With Immutability Bangalore, India London, UK
  • 17.
    © 1999-2017 ErlangSolutions Ltd 1 7 Connectivity
 With Immutability Bangalore, India London, UK
  • 18.
    © 1999-2017 ErlangSolutions Ltd Shared Memory 18 No Shared Memory Msg © 1999-2017 Erlang Solutions Ltd Two ways to do concurrency
  • 19.
    © 1999-2017 ErlangSolutions Ltd
  • 20.
    © 1999-2017 ErlangSolutions Ltd Source: Serious Eats
  • 21.
    © 1999-2017 ErlangSolutions Ltd 21 Distribution
  • 22.
    © 1999-2017 ErlangSolutions Ltd 22 Lambdas & Closures double([H|T]) -> [H*2|double(T)]; double([]) -> []. bump([H|T]) -> [H+1 | bump(T)]; bump([]) -> []. map(Fun, [H|T]) -> [Fun(H)|map(Fun,T)]; map(_Fun, []) -> []. double(L) -> map(fun(X)-> X*2 end,L). bump(L) -> map(fun(X)-> X+1 end,L).
  • 23.
    © 1999-2017 ErlangSolutions Ltd 23 Parallella Board Dual core ARM processor + Epiphany 16/64 core co-processor, FPGA Raspberry Pi 2 Quad core ARM processor, GPU © 1999-2017 Erlang Solutions Ltd From Embedded 
 Devices…
  • 24.
    © 1999-2017 ErlangSolutions Ltd© 1999-2017 Erlang Solutions Ltd 24 ●  93 petaflops/s (November 2016) ●  40,960 Nodes, each with 2 Ivy Bridge multicores and 3 Xeon Phis ●  3,120,000 x86 cores in total Sunway TaihuLight Chinese National University of Defence Technology To the Fastest 
 Computer in the 
 World!
  • 25.
    © 1999-2017 ErlangSolutions Ltd 25
  • 26.
    © 1999-2017 ErlangSolutions Ltd Concurrency + Distribution Immutability Concurrency Distribution
  • 27.
    © 1999-2017 ErlangSolutions Ltd Concurrency + Distribution Immutability Concurrency Distribution Multi-core Parallelism
  • 28.
    © 1999-2017 ErlangSolutions Ltd Concurrency + Distribution Immutability Concurrency Distribution Multi-core Parallelism Scalability Reliability
  • 29.
    © 1999-2017 ErlangSolutions Ltd Distribution Bangalore, India London, UK
  • 30.
    © 1999-2017 ErlangSolutions Ltd Distribution Bangalore, India London, UK
  • 31.
    © 1999-2017 ErlangSolutions Ltd Distribution Synchronous Asynchronous At the Most Once Exactly Once At Least Once Sequential Parallel
  • 32.
    © 1999-2017 ErlangSolutions Ltd 32
  • 33.
    © 1999-2017 ErlangSolutions Ltd 33 “Programming consists of overcoming two things: accidental difficulties, things which are difficult because you happen to be using inadequate programming tools, and things which are actually difficult, which no programming tool or language is going to solve.” - Joel Spolsky Questions?
  • 34.
    © 1999-2017 ErlangSolutions Ltd Francesco Cesarini Founder & Technical Director @ Erlang Solutions @FrancescoC francesco@erlang-solutions.com