Your SlideShare is downloading. ×
0
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Erlang Workshop at Dyncon 2011

1,160

Published on

In this session you'll become familiar with the basic syntax of Erlang, learn how to write programs and experience the central concepts of the language: functional programming, concurrency, fault …

In this session you'll become familiar with the basic syntax of Erlang, learn how to write programs and experience the central concepts of the language: functional programming, concurrency, fault tolerance and distribution. You will get familiar with the Erlang shell and basic Erlang programs, try concurrent programming by using message passing and get a taste of Erlang distribution.

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,160
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
48
Comments
0
Likes
3
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • Facebook (Chat), Amazon (SimpleDB), Klarna (E-Commerce billing), T-Mobile (SMS gateway), Yahoo! (Delicious), GitHub (RPC and Messaging), RabbitMQ (Enterprise messaging), CouchDB (NoSQL), Riak (NoSQL)\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript

    • 1. Erlang Solutions Ltd.Erlang Workshop © 1999-2011 Erlang Solutions Ltd.
    • 2. Erlang, the Language• Started out in the Ericsson software lab 1987 (!)• Released as open source in 1998• Gains Symmetric Multi Processing (SMP) support in 2005 2000000 1500000 1000000 Requests/Month 500000 0 1998 2001 2003 2005 2007 2009 © 2011 Erlang Solutions Ltd.
    • 3. Properties Functional programming language, high Declarative abstraction level, pattern matching and concise readable programs Either transparent or explicit concurrency, Concurrency light-weight processes and highly scalable Response times in the order of millisecondsSoft Real-Time per-process garbage collection © 2011 Erlang Solutions Ltd.
    • 4. Properties Simple and consistent error recovery, Robustness supervision hierarchies and "program for the correct case" Explicit or transparent distribution Distribution Network-aware runtime system Easily change code in a running system.Hot code loading Enables non-stop operation Simplifies testing © 2011 Erlang Solutions Ltd.
    • 5. Properties "Ports" to the outside world behave asExternal Interfaces Erlang processes Erlang runs on any UNIX, Windows, Portability VxWorks. Supports heterogeneous networks Symmetric multiprocessing support. Takes SMP Support full advantage of multiple CPU architectures © 2011 Erlang Solutions Ltd.
    • 6. Where is Erlang used? © 2011 Erlang Solutions Ltd.
    • 7. The Erlang Shell$ erlErlang R14B01 (erts-5.8.2) [...]Eshell V5.8.2 (abort with ^G)1> 2 + 3.52> [1, 2, 3] ++ [4, 5, 6].[1,2,3,4,5,6] © 2011 Erlang Solutions Ltd.
    • 8. The Erlang Shell3> A = test.test4> B = {“string”, A}.{“string”,test}5> {S, test} = B.{“string”,test}6> S. © 2011 Erlang Solutions Ltd.
    • 9. The Erlang Shell7> [72,101,108,108,111,32,87,111,114,108,100]."Hello World"8> [{person, "Joe", "Armstrong"}, {person,"Robert", "Virding"}, {person, "Mike","Williams"}].[{person, "Joe", "Armstrong"}, {person, "Robert", "Virding"}, {person, "Mike", "Williams"}] © 2011 Erlang Solutions Ltd.
    • 10. Modules & Functions-module(demo).-export([double/1]).% This is a comment.% Everything after % is ignored.double(X) ->    times(X, 2).times(X, N) ->    X * N. https://gist.github.com/854366 © 2011 Erlang Solutions Ltd.
    • 11. Modules & Functions-module(demo). module name-export([double/1]).% This is a comment.% Everything after % is ignored.double(X) ->    times(X, 2).times(X, N) ->    X * N. https://gist.github.com/854366 © 2011 Erlang Solutions Ltd.
    • 12. Modules & Functions-module(demo). module name-export([double/1]). exported functions% This is a comment.% Everything after % is ignored.double(X) ->    times(X, 2).times(X, N) ->    X * N. https://gist.github.com/854366 © 2011 Erlang Solutions Ltd.
    • 13. Modules & Functions-module(demo). module name-export([double/1]). exported functions comment% This is a comment.% Everything after % is ignored.double(X) ->    times(X, 2).times(X, N) ->    X * N. https://gist.github.com/854366 © 2011 Erlang Solutions Ltd.
    • 14. Modules & Functions-module(demo). module name-export([double/1]). exported functions comment% This is a comment.% Everything after % is ignored.double(X) -> function    times(X, 2).times(X, N) ->    X * N. https://gist.github.com/854366 © 2011 Erlang Solutions Ltd.
    • 15. Modules & Functions-module(demo). module name-export([double/1]). exported functions comment% This is a comment.% Everything after % is ignored.double(X) -> function    times(X, 2).times(X, N) -> last expression is the    X * N. return value https://gist.github.com/854366 © 2011 Erlang Solutions Ltd.
    • 16. Modules & Functions9> c(demo).{ok,demo}10> demo:double(21).4211> demo:times(3, 3).** exception error: undefined functiondemo:times/2 © 2011 Erlang Solutions Ltd.
    • 17. Processes © 2011 Erlang Solutions Ltd.
    • 18. Processes Pid = spawn(M, F, A) © 2011 Erlang Solutions Ltd.
    • 19. Processes Pid = spawn(M, F, A) M:F(A) receive {msg, From} -> From ! ok end © 2011 Erlang Solutions Ltd.
    • 20. Processes Pid = spawn(M, F, A) M:F(A) Pid ! {msg, self()} receive {msg, From} -> From ! ok end © 2011 Erlang Solutions Ltd.
    • 21. Processes Pid = spawn(M, F, A) M:F(A) Pid ! {msg, self()} receive ok {msg, From} -> From ! ok end © 2011 Erlang Solutions Ltd.
    • 22. Processes © 2011 Erlang Solutions Ltd.
    • 23. Processes supervisor © 2011 Erlang Solutions Ltd.
    • 24. Processes supervisor worker © 2011 Erlang Solutions Ltd.
    • 25. Processes supervisor worker © 2011 Erlang Solutions Ltd.
    • 26. Processes © 2011 Erlang Solutions Ltd.
    • 27. Processes Application 1 © 2011 Erlang Solutions Ltd.
    • 28. Processes Application Application Application 1 2 3 © 2011 Erlang Solutions Ltd.
    • 29. Processes node@host Application Application Application 1 2 3 © 2011 Erlang Solutions Ltd.
    • 30. Distribution © 2011 Erlang Solutions Ltd.
    • 31. Distribution cat nodes() = [] © 2011 Erlang Solutions Ltd.
    • 32. Distribution cat flea nodes() =[cat@home, flea@home] © 2011 Erlang Solutions Ltd.
    • 33. Distribution cat dog flea nodes() = nodes() =[cat@home, flea@home] [] © 2011 Erlang Solutions Ltd.
    • 34. Distribution cat dog flea bird nodes() = nodes() =[cat@home, flea@home] [dog@work, bird@work] © 2011 Erlang Solutions Ltd.
    • 35. Distribution cat dog flea bird nodes() = [cat@home, flea@home, dog@work, bird@work] © 2011 Erlang Solutions Ltd.
    • 36. Demo time! © 1999-2011 Erlang Solutions Ltd.
    • 37. A Talking Virus • A module that starts a process • When that process detects a new node in the cluster - It will copy the module to that node - And start a new process on that node - Which will do the same to connecting nodes • Source code: https://gist.github.com/854389 © 2011 Erlang Solutions Ltd.
    • 38. A Talking Virus$ erl -name somename -setcookie dyncon...Eshell V5.8.2 (abort with ^G)(somename@somehost)1> nodes().[](somename@somehost)2> net_adm:ping(adam@192.168.161.166).pong © 2011 Erlang Solutions Ltd.
    • 39. Resources http://tryerlang.orghttp://learnyousomeerlang.com © 1999-2011 Erlang Solutions Ltd.
    • 40. Thank you!adam@erlang-solutions.com @eproxus © 1999-2011 Erlang Solutions Ltd.

    ×