2. Agenda
History of Erlang
Erlang Features
Erlang/OTP and design patterns
Tools applications
Applications written in Erlang
Erlang IDEs
Erlang syntax
How to get Erlang
Demo
Conclusion
Q&A
3. History of Erlang
Erlang is a programming
language
Ericsson wanted
programming language for
developing
telecommunication switching
systems.
The language must be a very
high level symbolic language
in order to achieve
productivity gains
The language must contain
primitives for concurrency
and error recovery
4. History of Erlang
1998:
No language well suited Open Source
for telecom systems Erlang
1984: development
Ericsson
Computer
Science Lab 1991:
formed First fast
implementation
1987:
1984-86: Early Erlang
Experiments Prototype 1996:
programming projects Open Telecom Platform
POTS with (research on verification...)
several languages 1995:
Several
new projects
1993:
Distributed
Erlang
5. Erlang is Concurrent functional
programming language
It was designed by Ericsson to support distributed, fault-tolerant,
soft-real-time, and non-stop applications
6. Erlang Features
Concurrency
Fault tolerance
Soft Real-Time
Distribution
Hot Code Loading
External Interfaces
Platform Independent
18. Hello world Program
Save the file as
“hello_world.erl”, After
-module(hello_world). compilation output will
be “hello_world.beam”
-export([print/0]).
$ erl
Eshell V 5.7.1 (abort with ^G)
print() -> 1> c(hello_world).
{ok, hello_world}
io:format(“Hello World…!~n”). 2> hello_world:print().
Hello World…!
3>
19. How Erlang works
Pattern matching technique
Var = 3.
[Var1, Var2] = [3, 4].
{Var3, _Var4, Var5} = {4, 5, a}.
[H | T] = [iti, erlang, course, book].
1 = 1.
{ok, Var} = {ok, “Connected to DB”}. √
1 = 2.
{ok, var} = {ok, “Connected to DB”}. X
20. Recursion and Tail Recursion
fact(0) -> fact(N) ->
1; fact_help(N, 1).
fact(N) when N>0 ->
N * fact(N -1). fact_help(0, Acc) ->
Acc;
fact_help(N, Acc) when N>0 ->
NewAcc = N * Acc,
fact_help(N-1, NewAcc).
21. Quick Sort
quicksort([]) -> % If the list [] is empty, return an empty list (nothing to sort)
[];
quicksort([Pivot|Rest]) ->
quicksort([Front || Front <- Rest, Front < Pivot])
++ [Pivot] ++
quicksort([Back || Back <- Rest, Back >= Pivot]).
22. How to get Erlang
Erlang.org
Download
Documentation
Trapexit.org
Erlang Factory
Erlang-Consulting
27. Distributed application
Timeout to wait until
restart application on
Nodes
other node
[{kernel,
[{distributed,
[{dist_app, 5000, [‘node1@ricsson.com’, {‘node2@ricsson.com’, ‘node3@ricsson.com’}]}]},
{sync_nodes_mandatory, [‘node2@ricsson.com’, ‘node3@ricsson.com’]},
{sync_nodes_timeout, 5000} ] } ].
Specifies how many
milliseconds to wait for
the other nodes to
start
28. Conclusion
Erlang is concurrent functional programming
language.
Its main goal is error recovery, fault tolerant,
distributed applications, and non-stop applications.
It released to Open source since 1998.
Companies that are using Erlang.
How Erlang works.
How to get and use Erlang.