why erlang

37
ERLANG SILICON VALLEY MEETUP April 14, 2014

Upload: doug-goldie

Post on 13-May-2015

292 views

Category:

Internet


0 download

DESCRIPTION

First Erlang Silicon Valley meetup. Discussing Why we should learn and use Erlang.

TRANSCRIPT

Page 1: Why erlang

ERLANGSILICON VALLEY

MEETUP

April 14, 2014

Page 2: Why erlang

AGENDA6:30 - Doors open

6:45 - Introduction / Announcements

7:00 - Why Erlang?

7:45 - Meetup Organization

8:15 - Erlang Intro

9:00 - Doors close

Page 3: Why erlang

INTRODUCTION AND

ANNOUNCEMENTS

Page 4: Why erlang

DOUG GOLDIE

Freelance developer, architect, consultant

Ruby, Rails stack

Boatbound, V.me at Visa, Paynearme

[email protected]

Page 5: Why erlang

WHY ERLANG?by Doug Goldie

Page 6: Why erlang

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

Page 7: Why erlang

A YEAR AGO…• I took the summer off….

•“Why Erlang?”

•Challenges of SOA

•Curious about Erlang.

•Learn a functional language again.

Page 8: Why erlang

ERICSSON

Page 9: Why erlang

TELECOM NEEDED• Concurrency• Distribution• Fault Tolerance• Soft real-time• Hot code upgrade• Incremental code loading• External interfaces

Page 10: Why erlang

ERLANG

Page 11: Why erlang

CONCURRENCY

• Isolated processes

•Asynchronous messaging passing

•Actor model

Page 12: Why erlang
Page 13: Why erlang
Page 14: Why erlang
Page 15: Why erlang

Distributed

Page 16: Why erlang

FAULT TOLERANCE

Reliability

Redundancy

Nine nines 99.9999999%

Page 17: Why erlang

SOFT REAL-TIME

Page 18: Why erlang

Deadlines

Soft allows some slip

SOFT REAL-TIME

Lightweight processes.

Garbage collection

Page 19: Why erlang

HOT CODE UPGRADE

Page 20: Why erlang
Page 21: Why erlang

INCREMENTAL CODE LOADING

Page 22: Why erlang

EXTERNAL INTERFACES

Page 23: Why erlang

–Robert Virding, OTP class, 2014

“It’s about building Systems.”

Page 24: Why erlang

ERLANG LANGUAGE

Page 25: Why erlang

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

Page 26: Why erlang

MODULES, ETC.

• Modules

• Behaviours

Page 27: Why erlang

ERLANG/OTP

Page 28: Why erlang

OTP•Library of Design Patterns

•Supervision Tree

•Workers and supervisors

•Behaviours

Page 29: Why erlang

CLIENT SERVER

gen_server

Page 30: Why erlang

FINITE STATE MACHINE

gen_fsm

Page 31: Why erlang
Page 32: Why erlang

ELIXIR

• Jose Valim

• Light layer of syntactic sugar

• Pipes

• Macros

Page 33: Why erlang

THE WEB

Page 34: Why erlang

THE WEB

• Concurrent

• Soft real-time

• Asynchronous

• Omnipresent

• Internet of Things

Page 35: Why erlang
Page 36: Why erlang

REFERENCES• Erlang and the Web

http://ninenines.eu/docs/en/cowboy/HEAD/guide/erlang_web/

• Concurrency Oriented Programming in Erlanghttp://www.guug.de/veranstaltungen/ffg2003/papers/ffg2003-armstrong.pdf

• Why OO Suckshttp://www.sics.se/~joe/bluetail/vol1/v1_oo.html

• Erlang Centralhttps://erlangcentral.org/

• Erlang Historyhttp://www.erlang.org/faq/academic.html

• WhatsApp presentationhttp://www.erlang-factory.com/conference/show/conference-6/home/#rick-reed