Slide 1

Slide 1 text

What Even Is An Erlang? Christopher Meiklejohn Wicked Good Ruby Lightning Talk Friday, October 11, 13

Slide 2

Slide 2 text

What do you do? Friday, October 11, 13

Slide 3

Slide 3 text

Friday, October 11, 13

Slide 4

Slide 4 text

Friday, October 11, 13

Slide 5

Slide 5 text

Friday, October 11, 13

Slide 6

Slide 6 text

Friday, October 11, 13

Slide 7

Slide 7 text

Friday, October 11, 13

Slide 8

Slide 8 text

What Even Is An Erlang? Friday, October 11, 13

Slide 9

Slide 9 text

Concurrent, garbage-collected, runtime. What Even Is An Erlang? Friday, October 11, 13

Slide 10

Slide 10 text

Functional, strict, single assignment, dynamic. What Even Is An Erlang? Friday, October 11, 13

Slide 11

Slide 11 text

Actors, hot-code loading, message passing. What Even Is An Erlang? Friday, October 11, 13

Slide 12

Slide 12 text

Module example. What Even Is An Erlang? Friday, October 11, 13

Slide 13

Slide 13 text

-module(fact). -export([fac/1]). fac(0) -> 1; fac(N) when N > 0, is_integer(N) -> N * fac(N-1). Friday, October 11, 13

Slide 14

Slide 14 text

Concurrency and messaging example. What Even Is An Erlang? Friday, October 11, 13

Slide 15

Slide 15 text

% Create a process and invoke the function web:start_server(Port, MaxConnections) ServerProcess = spawn(web, start_server, [Port, MaxConnections]), Friday, October 11, 13

Slide 16

Slide 16 text

% Create a process and invoke the function web:start_server(Port, MaxConnections) ServerProcess = spawn(web, start_server, [Port, MaxConnections]), % Create a remote process and invoke the function % web:start_server(Port, MaxConnections) on machine RemoteNode RemoteProcess = spawn(RemoteNode, web, start_server, [Port, MaxConnections]), Friday, October 11, 13

Slide 17

Slide 17 text

% Create a process and invoke the function web:start_server(Port, MaxConnections) ServerProcess = spawn(web, start_server, [Port, MaxConnections]), % Create a remote process and invoke the function % web:start_server(Port, MaxConnections) on machine RemoteNode RemoteProcess = spawn(RemoteNode, web, start_server, [Port, MaxConnections]), % Send a message to ServerProcess (asynchronously). The message consists of a tuple % with the atom "pause" and the number "10". ServerProcess ! {pause, 10}, Friday, October 11, 13

Slide 18

Slide 18 text

% Create a process and invoke the function web:start_server(Port, MaxConnections) ServerProcess = spawn(web, start_server, [Port, MaxConnections]), % Create a remote process and invoke the function % web:start_server(Port, MaxConnections) on machine RemoteNode RemoteProcess = spawn(RemoteNode, web, start_server, [Port, MaxConnections]), % Send a message to ServerProcess (asynchronously). The message consists of a tuple % with the atom "pause" and the number "10". ServerProcess ! {pause, 10}, % Receive messages sent to this process receive a_message -> do_something; {data, DataContent} -> handle(DataContent); {hello, Text} -> io:format("Got hello message: ~s", [Text]); {goodbye, Text} -> io:format("Got goodbye message: ~s", [Text]) end. Friday, October 11, 13

Slide 19

Slide 19 text

Erlang/OTP Friday, October 11, 13

Slide 20

Slide 20 text

Open Telecom Platform Erlang/OTP Friday, October 11, 13

Slide 21

Slide 21 text

Series of design principles; behaviours. Erlang/OTP Friday, October 11, 13

Slide 22

Slide 22 text

application: OTP applications Erlang/OTP Friday, October 11, 13

Slide 23

Slide 23 text

supervisor: process supervision trees Erlang/OTP Friday, October 11, 13

Slide 24

Slide 24 text

gen_server: generic server Erlang/OTP Friday, October 11, 13

Slide 25

Slide 25 text

gen_fsm: generic !nite state machine Erlang/OTP Friday, October 11, 13

Slide 26

Slide 26 text

gen_event: generic event handler Erlang/OTP Friday, October 11, 13

Slide 27

Slide 27 text

Erlang/OTP Supervisors Friday, October 11, 13

Slide 28

Slide 28 text

S Friday, October 11, 13

Slide 29

Slide 29 text

S F Friday, October 11, 13

Slide 30

Slide 30 text

S F F Friday, October 11, 13

Slide 31

Slide 31 text

S F F F Friday, October 11, 13

Slide 32

Slide 32 text

Who Is Using Erlang? Friday, October 11, 13

Slide 33

Slide 33 text

ejabberd, Facebook Chat Who Is Using Erlang? Friday, October 11, 13

Slide 34

Slide 34 text

RabbitMQ, Chef Who Is Using Erlang? Friday, October 11, 13

Slide 35

Slide 35 text

Cloudant, Basho Who Is Using Erlang? Friday, October 11, 13

Slide 36

Slide 36 text

League of Legends, Call of Duty Who Is Using Erlang? Friday, October 11, 13

Slide 37

Slide 37 text

Try Erlang for your next project! Friday, October 11, 13

Slide 38

Slide 38 text

Thanks! Friday, October 11, 13