ERLANG
SILICON VALLEY
MEETUP
April 14, 2014
AGENDA
6:30 - Doors open
6:45 - Introduction / Announcements
7:00 - Why Erlang?
7:45 - Meetup Organization
8:15 - Erlang Intro
9:00 - Doors close
INTRODUCTION
AND
ANNOUNCEMENTS
DOUG GOLDIE
Freelance developer, architect, consultant
Ruby, Rails stack
Boatbound, V.me at Visa, Paynearme
doug@codecauldron.com
WHY ERLANG?
by Doug Goldie
WHATSAPP
• 465M monthly users
• 19B messages in & 40B out per day
• Small team (~10 on Erlang),
handle development and ops
• ~ 550 servers + standby gear
• > 11,000 cores
A YEAR AGO…
• I took the summer off….
• “Why Erlang?”
• Challenges of SOA
• Curious about Erlang.
• Learn a functional language again.
ERICSSON
TELECOM NEEDED
• Concurrency
• Distribution
• Fault Tolerance
• Soft real-time
• Hot code upgrade
• Incremental code loading
• External interfaces
ERLANG
CONCURRENCY
• Isolated processes
• Asynchronous messaging passing
• Actor model
Distributed
FAULT TOLERANCE
Reliability
Redundancy
Nine nines 99.9999999%
SOFT REAL-TIME
Deadlines
Soft allows some slip
SOFT REAL-TIME
Lightweight processes.
Garbage collection
HOT
CODE
UPGRAD
E
INCREMENTAL CODE LOADING
EXTERNAL INTERFACES
–Robert Virding, OTP class, 2014
“It’s about building Systems.”
ERLANG LANGUAGE
FUNCTIONAL
fac(N) when N == 0 -> 1;
fac(N) when N > 0 -> N*fac(N-1).
Recursion
double([H|T]) -> [2*H|double(T)];
double([]) -> [].
Pattern matching
MODULES, ETC.
• Modules
• Behaviours
ERLANG/OTP
OTP• Library of Design
Patterns
• Supervision Tree
• Workers and
supervisors
• Behaviours
CLIENT SERVER
gen_server
FINITE STATE MACHINE
gen_fsm
ELIXIR
• Jose Valim
• Light layer of syntactic sugar
• Pipes
• Macros
THE WEB
THE WEB
• Concurrent
• Soft real-time
• Asynchronous
• Omnipresent
• Internet of Things
REFERENCES
• Erlang and the Web
http://ninenines.eu/docs/en/cowboy/HEAD/guide/erlang_web/
• Concurrency Oriented Programming in Erlang
http://www.guug.de/veranstaltungen/ffg2003/papers/ffg2003-armstrong.pdf
• Why OO Sucks
http://www.sics.se/~joe/bluetail/vol1/v1_oo.html
• Erlang Central
https://erlangcentral.org/
• Erlang History
http://www.erlang.org/faq/academic.html
• WhatsApp presentation
http://www.erlang-factory.com/conference/show/conference-6/home/#rick-reed
DOUG GOLDIE
doug@codecauldron.com

Why erlang