a brief introduction to erlang

10

Click here to load reader

Upload: phillip-trelford

Post on 06-May-2015

833 views

Category:

Technology


4 download

DESCRIPTION

A Brief Introduction To Erlang - Lighting Talk

TRANSCRIPT

Page 1: A Brief Introduction To Erlang

A Brief Introduction to ErlangPhillip Trelford Lightning Talk 2012

Page 2: A Brief Introduction To Erlang

Erlang in Industry• Amazon

▫SimpleDB for Amazon Elastic Compute Cloud (EC2)

• Yahoo! ▫Delicious social bookmarking (50 million users)

• Facebook ▫Chat service (100 million users)

• T-Mobile ▫SMS and authentication systems

• Ericsson▫Support nodes in GPRS & 3G mobile networks

Page 3: A Brief Introduction To Erlang

Open Source Erlang

•RabbitMQ▫AMQP based messaging

•CouchDB▫Document-oriented database

•Riak▫Distributed database

•Ejabberd ▫XMPP based instant messaging (IM)

Page 4: A Brief Introduction To Erlang

Why Erlang? Wooga Case StudyBefore After

• Social Games• Millions of daily users• 80 – 200 App Servers• 5000 – 7000 RPS

• 1 App Server*

* Actually 2 for redundancy

Page 5: A Brief Introduction To Erlang

Blackjack functionC# Erlang

public static bool IsBlackjack(int[] ranks){ return ranks.Length == 2 && ranks[0] + ranks[1] == 21;}

isBlackjack([A,B]) when A+B==21 -> true;

isBlackjack(_) -> false.

Page 6: A Brief Introduction To Erlang

Coding Erlang

Text Editor REPL Winning

Page 7: A Brief Introduction To Erlang

Card Shuffle in Erlang REPL

Ranks=["A","1","2","3","10","J","Q","K"].Suits=[clubs,diamonds,hearts,spades].Deck=[{Rank,Suit}||Rank<-Ranks,Suit<-

Suits].Tuples=[{random:uniform(),Card}||Card<-

Deck].[Card||{_,Card}<-lists:keysort(1,Tuples)].

Page 8: A Brief Introduction To Erlang

Why learn Erlang?

•Money▫Erlang will instantly net you a $100,000

salary•Power

▫99.9999999% Reliability•Respect

▫Scala Akka▫F# Agents▫TPL DataFlow (TDF)

Page 9: A Brief Introduction To Erlang

Erlang Book Stack

Page 10: A Brief Introduction To Erlang

Next Steps

•Read ▫Learn You Some Erlang For Great Good!

•Watch▫Erlang: The Movie

•Try▫Coding Katas

•Get the T-Shirt▫#Erlang