erlang introduction geek2geek berlin

22
Erlang introduction Paolo Negri @hungryblank

Upload: paolo-negri

Post on 28-Nov-2014

681 views

Category:

Technology


0 download

DESCRIPTION

Introduction about erlang given at the berlin geek2geek meetup

TRANSCRIPT

Page 1: Erlang introduction geek2geek Berlin

Erlang introductionPaolo Negri @hungryblank

Page 2: Erlang introduction geek2geek Berlin

ME

• confounder at contentful.com

• experience in erlang from building game servers

• interested in programming languages

Page 3: Erlang introduction geek2geek Berlin

“Traveling, whether in the mental or the physical word

is a Joy”Bertrand Russell

“The anlysis of mind”

Page 4: Erlang introduction geek2geek Berlin

Agenda

• Why erlang is a place worth visiting

Page 5: Erlang introduction geek2geek Berlin

How would you visualize your code running?

Page 7: Erlang introduction geek2geek Berlin

Erlang

Page 8: Erlang introduction geek2geek Berlin

Erlang

Page 9: Erlang introduction geek2geek Berlin

Erlang

Page 11: Erlang introduction geek2geek Berlin

2 Concepts

1) Process

2) Message

Page 12: Erlang introduction geek2geek Berlin

How it works?

A process sends and receives

messages to/from other

processes

Page 13: Erlang introduction geek2geek Berlin

Process

Erlang processes are light-weightwith small memory footprint,fast to create and terminate, scheduling overhead is low.

Erlang documentation

Page 14: Erlang introduction geek2geek Berlin

Process is key to

• Concurrency

• Isolation

• Fault tolerance

• Control of state

Page 15: Erlang introduction geek2geek Berlin

Message

Messages between processes are simply valid Erlang terms

They can belists, tuples, integers...

Page 17: Erlang introduction geek2geek Berlin

Single Assignment?a.k.a immutability

“Once created by single assignment, named values are not variables but immutable objects.”

Wikipedia

Page 18: Erlang introduction geek2geek Berlin

Mutabilityaccess only current state

Page 19: Erlang introduction geek2geek Berlin

Immutabilityaccess all states

Page 20: Erlang introduction geek2geek Berlin

What for?

• Building reliable systems

• Building high concurrency systems

• Building SOA infrastructure

Page 22: Erlang introduction geek2geek Berlin

Questions?