SlideShare a Scribd company logo
1 of 40
Erlang Solutions Ltd.



Erlang Workshop

                        © 1999-2011 Erlang Solutions Ltd.
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.
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 milliseconds
Soft Real-Time
                 per-process garbage collection



                      © 2011 Erlang Solutions Ltd.
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.
Properties

                      "Ports" to the outside world behave as
External 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.
Where is Erlang used?




            © 2011 Erlang Solutions Ltd.
The Erlang Shell
$ erl
Erlang R14B01 (erts-5.8.2) [...]

Eshell V5.8.2 (abort with ^G)

1> 2 + 3.
5

2> [1, 2, 3] ++ [4, 5, 6].
[1,2,3,4,5,6]


                    © 2011 Erlang Solutions Ltd.
The Erlang Shell
3> A = test.
test

4> B = {“string”, A}.
{“string”,test}

5> {S, test} = B.
{“string”,test}

6> S.


                    © 2011 Erlang Solutions Ltd.
The Erlang Shell
7> [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.
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.
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.
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.
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.
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.
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.
Modules & Functions
9> c(demo).
{ok,demo}

10> demo:double(21).
42

11> demo:times(3, 3).
** exception error: undefined function
demo:times/2



                   © 2011 Erlang Solutions Ltd.
Processes




            © 2011 Erlang Solutions Ltd.
Processes

  Pid = spawn(M, F, A)




                 © 2011 Erlang Solutions Ltd.
Processes

  Pid = spawn(M, F, A)
                                                  M:F(A)


                                                receive
                                                 {msg, From} ->
                                                   From ! ok
                                                end



                 © 2011 Erlang Solutions Ltd.
Processes

   Pid = spawn(M, F, A)
                                                     M:F(A)

  Pid ! {msg, self()}
                                                   receive
                                                    {msg, From} ->
                                                      From ! ok
                                                   end



                    © 2011 Erlang Solutions Ltd.
Processes

   Pid = spawn(M, F, A)
                                                      M:F(A)

  Pid ! {msg, self()}
                                                    receive
                ok                                   {msg, From} ->
                                                       From ! ok
                                                    end



                     © 2011 Erlang Solutions Ltd.
Processes




            © 2011 Erlang Solutions Ltd.
Processes
                                       supervisor




            © 2011 Erlang Solutions Ltd.
Processes
                                       supervisor




 worker




            © 2011 Erlang Solutions Ltd.
Processes
                                       supervisor




 worker




            © 2011 Erlang Solutions Ltd.
Processes




            © 2011 Erlang Solutions Ltd.
Processes



 Application
      1




               © 2011 Erlang Solutions Ltd.
Processes



 Application    Application                   Application
      1              2                             3




               © 2011 Erlang Solutions Ltd.
Processes
                node@host



 Application    Application                   Application
      1              2                             3




               © 2011 Erlang Solutions Ltd.
Distribution




               © 2011 Erlang Solutions Ltd.
Distribution

      cat




    nodes() =
       []

                © 2011 Erlang Solutions Ltd.
Distribution

        cat



       flea
      nodes() =
[cat@home, flea@home]

                 © 2011 Erlang Solutions Ltd.
Distribution

        cat                                      dog



       flea
      nodes() =                                 nodes() =
[cat@home, flea@home]                               []

                 © 2011 Erlang Solutions Ltd.
Distribution

        cat                                     dog



       flea                                      bird
      nodes() =                            nodes() =
[cat@home, flea@home]                 [dog@work, bird@work]

                 © 2011 Erlang Solutions Ltd.
Distribution

       cat                                     dog



      flea                                      bird
                 nodes() =
 [cat@home, flea@home, dog@work, bird@work]

                © 2011 Erlang Solutions Ltd.
Demo time!


 © 1999-2011 Erlang Solutions Ltd.
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.
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.
Resources
       http://tryerlang.org
http://learnyousomeerlang.com




        © 1999-2011 Erlang Solutions Ltd.
Thank you!
adam@erlang-solutions.com
      @eproxus



      © 1999-2011 Erlang Solutions Ltd.

More Related Content

What's hot

SQLAlchemy Core: An Introduction
SQLAlchemy Core: An IntroductionSQLAlchemy Core: An Introduction
SQLAlchemy Core: An IntroductionJason Myers
 
ZIO: Powerful and Principled Functional Programming in Scala
ZIO: Powerful and Principled Functional Programming in ScalaZIO: Powerful and Principled Functional Programming in Scala
ZIO: Powerful and Principled Functional Programming in ScalaWiem Zine Elabidine
 
Leveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results AsynchrhonouslyLeveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results AsynchrhonouslyDavid Gómez García
 
Java 8: the good, the bad and the ugly (Oracle Code Brussels 2017)
Java 8: the good, the bad and the ugly (Oracle Code Brussels 2017)Java 8: the good, the bad and the ugly (Oracle Code Brussels 2017)
Java 8: the good, the bad and the ugly (Oracle Code Brussels 2017)Brian Vermeer
 
デザインキット・D級アンプのスタートアップガイド
デザインキット・D級アンプのスタートアップガイドデザインキット・D級アンプのスタートアップガイド
デザインキット・D級アンプのスタートアップガイドTsuyoshi Horigome
 
Java 8: the good, the bad and the ugly (JBCNConf 2017)
Java 8: the good, the bad and the ugly (JBCNConf 2017)Java 8: the good, the bad and the ugly (JBCNConf 2017)
Java 8: the good, the bad and the ugly (JBCNConf 2017)Brian Vermeer
 
The Ring programming language version 1.2 book - Part 16 of 84
The Ring programming language version 1.2 book - Part 16 of 84The Ring programming language version 1.2 book - Part 16 of 84
The Ring programming language version 1.2 book - Part 16 of 84Mahmoud Samir Fayed
 
Appium Automation with Kotlin
Appium Automation with KotlinAppium Automation with Kotlin
Appium Automation with KotlinRapidValue
 
Testing My Patience
Testing My PatienceTesting My Patience
Testing My PatienceAdam Lowry
 
Introduction to SQLAlchemy and Alembic Migrations
Introduction to SQLAlchemy and Alembic MigrationsIntroduction to SQLAlchemy and Alembic Migrations
Introduction to SQLAlchemy and Alembic MigrationsJason Myers
 
Introduction to SQLAlchemy ORM
Introduction to SQLAlchemy ORMIntroduction to SQLAlchemy ORM
Introduction to SQLAlchemy ORMJason Myers
 
The Java Fx Platform – A Java Developer’S Guide
The Java Fx Platform – A Java Developer’S GuideThe Java Fx Platform – A Java Developer’S Guide
The Java Fx Platform – A Java Developer’S GuideStephen Chin
 
Thirteen ways of looking at a turtle
Thirteen ways of looking at a turtleThirteen ways of looking at a turtle
Thirteen ways of looking at a turtleScott Wlaschin
 
DRYing to Monad in Java8
DRYing to Monad in Java8DRYing to Monad in Java8
DRYing to Monad in Java8Dhaval Dalal
 
0003 es5 핵심 정리
0003 es5 핵심 정리0003 es5 핵심 정리
0003 es5 핵심 정리욱래 김
 
Error Management: Future vs ZIO
Error Management: Future vs ZIOError Management: Future vs ZIO
Error Management: Future vs ZIOJohn De Goes
 

What's hot (20)

SQLAlchemy Core: An Introduction
SQLAlchemy Core: An IntroductionSQLAlchemy Core: An Introduction
SQLAlchemy Core: An Introduction
 
Erlang/OTP in Riak
Erlang/OTP in RiakErlang/OTP in Riak
Erlang/OTP in Riak
 
ZIO: Powerful and Principled Functional Programming in Scala
ZIO: Powerful and Principled Functional Programming in ScalaZIO: Powerful and Principled Functional Programming in Scala
ZIO: Powerful and Principled Functional Programming in Scala
 
Zio from Home
Zio from Home Zio from Home
Zio from Home
 
Leveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results AsynchrhonouslyLeveraging Completable Futures to handle your query results Asynchrhonously
Leveraging Completable Futures to handle your query results Asynchrhonously
 
Friendly Functional Programming
Friendly Functional ProgrammingFriendly Functional Programming
Friendly Functional Programming
 
Java 8: the good, the bad and the ugly (Oracle Code Brussels 2017)
Java 8: the good, the bad and the ugly (Oracle Code Brussels 2017)Java 8: the good, the bad and the ugly (Oracle Code Brussels 2017)
Java 8: the good, the bad and the ugly (Oracle Code Brussels 2017)
 
デザインキット・D級アンプのスタートアップガイド
デザインキット・D級アンプのスタートアップガイドデザインキット・D級アンプのスタートアップガイド
デザインキット・D級アンプのスタートアップガイド
 
Java 8: the good, the bad and the ugly (JBCNConf 2017)
Java 8: the good, the bad and the ugly (JBCNConf 2017)Java 8: the good, the bad and the ugly (JBCNConf 2017)
Java 8: the good, the bad and the ugly (JBCNConf 2017)
 
The Ring programming language version 1.2 book - Part 16 of 84
The Ring programming language version 1.2 book - Part 16 of 84The Ring programming language version 1.2 book - Part 16 of 84
The Ring programming language version 1.2 book - Part 16 of 84
 
Appium Automation with Kotlin
Appium Automation with KotlinAppium Automation with Kotlin
Appium Automation with Kotlin
 
Testing My Patience
Testing My PatienceTesting My Patience
Testing My Patience
 
Introduction to SQLAlchemy and Alembic Migrations
Introduction to SQLAlchemy and Alembic MigrationsIntroduction to SQLAlchemy and Alembic Migrations
Introduction to SQLAlchemy and Alembic Migrations
 
Introduction to SQLAlchemy ORM
Introduction to SQLAlchemy ORMIntroduction to SQLAlchemy ORM
Introduction to SQLAlchemy ORM
 
The Java Fx Platform – A Java Developer’S Guide
The Java Fx Platform – A Java Developer’S GuideThe Java Fx Platform – A Java Developer’S Guide
The Java Fx Platform – A Java Developer’S Guide
 
Thirteen ways of looking at a turtle
Thirteen ways of looking at a turtleThirteen ways of looking at a turtle
Thirteen ways of looking at a turtle
 
DRYing to Monad in Java8
DRYing to Monad in Java8DRYing to Monad in Java8
DRYing to Monad in Java8
 
Berlin meetup
Berlin meetupBerlin meetup
Berlin meetup
 
0003 es5 핵심 정리
0003 es5 핵심 정리0003 es5 핵심 정리
0003 es5 핵심 정리
 
Error Management: Future vs ZIO
Error Management: Future vs ZIOError Management: Future vs ZIO
Error Management: Future vs ZIO
 

Similar to Erlang Workshop

Introduction To Erlang Final
Introduction To Erlang   FinalIntroduction To Erlang   Final
Introduction To Erlang FinalSinarShebl
 
Thinking in a Highly Concurrent, Mostly-functional Language - Cesarini
Thinking in a Highly Concurrent, Mostly-functional Language - CesariniThinking in a Highly Concurrent, Mostly-functional Language - Cesarini
Thinking in a Highly Concurrent, Mostly-functional Language - CesariniCodemotion
 
The Erlang Programming Language
The Erlang Programming LanguageThe Erlang Programming Language
The Erlang Programming LanguageDennis Byrne
 
Architecting Scalable Platforms in Erlang/OTP | Hamidreza Soleimani | Diginex...
Architecting Scalable Platforms in Erlang/OTP | Hamidreza Soleimani | Diginex...Architecting Scalable Platforms in Erlang/OTP | Hamidreza Soleimani | Diginex...
Architecting Scalable Platforms in Erlang/OTP | Hamidreza Soleimani | Diginex...Hamidreza Soleimani
 
The Erlang Programming Language
The Erlang Programming LanguageThe Erlang Programming Language
The Erlang Programming LanguageDennis Byrne
 
Introduction to Erlang/(Elixir) at a Webilea Hands-On Session
Introduction to Erlang/(Elixir) at a Webilea Hands-On SessionIntroduction to Erlang/(Elixir) at a Webilea Hands-On Session
Introduction to Erlang/(Elixir) at a Webilea Hands-On SessionAndré Graf
 
Erlang For Five Nines
Erlang For Five NinesErlang For Five Nines
Erlang For Five NinesBarcamp Cork
 
Erlang from behing the trenches by Francesco Cesarini
Erlang from behing the trenches by Francesco CesariniErlang from behing the trenches by Francesco Cesarini
Erlang from behing the trenches by Francesco CesariniNaresh Jain
 
Bootstrap |> Elixir - Easy fun for busy developers
Bootstrap |> Elixir - Easy fun for busy developersBootstrap |> Elixir - Easy fun for busy developers
Bootstrap |> Elixir - Easy fun for busy developersDavid Schmitz
 
Oracle china campus recruitment ben xu
Oracle china campus recruitment ben xuOracle china campus recruitment ben xu
Oracle china campus recruitment ben xuBen Xu
 
Erlang Message Passing Concurrency, For The Win
Erlang  Message  Passing  Concurrency,  For  The  WinErlang  Message  Passing  Concurrency,  For  The  Win
Erlang Message Passing Concurrency, For The Winl xf
 
Mule Meetup Hyderabad
Mule Meetup HyderabadMule Meetup Hyderabad
Mule Meetup HyderabadVijay Reddy
 
Introducing Elixir and OTP at the Erlang BASH
Introducing Elixir and OTP at the Erlang BASHIntroducing Elixir and OTP at the Erlang BASH
Introducing Elixir and OTP at the Erlang BASHdevbash
 

Similar to Erlang Workshop (20)

Introduction To Erlang Final
Introduction To Erlang   FinalIntroduction To Erlang   Final
Introduction To Erlang Final
 
Thinking in a Highly Concurrent, Mostly-functional Language - Cesarini
Thinking in a Highly Concurrent, Mostly-functional Language - CesariniThinking in a Highly Concurrent, Mostly-functional Language - Cesarini
Thinking in a Highly Concurrent, Mostly-functional Language - Cesarini
 
Erlang in 10 minutes
Erlang in 10 minutesErlang in 10 minutes
Erlang in 10 minutes
 
The Erlang Programming Language
The Erlang Programming LanguageThe Erlang Programming Language
The Erlang Programming Language
 
Intel open mp
Intel open mpIntel open mp
Intel open mp
 
Elixir
ElixirElixir
Elixir
 
Erlang, an overview
Erlang, an overviewErlang, an overview
Erlang, an overview
 
Architecting Scalable Platforms in Erlang/OTP | Hamidreza Soleimani | Diginex...
Architecting Scalable Platforms in Erlang/OTP | Hamidreza Soleimani | Diginex...Architecting Scalable Platforms in Erlang/OTP | Hamidreza Soleimani | Diginex...
Architecting Scalable Platforms in Erlang/OTP | Hamidreza Soleimani | Diginex...
 
The Erlang Programming Language
The Erlang Programming LanguageThe Erlang Programming Language
The Erlang Programming Language
 
Introduction to Erlang/(Elixir) at a Webilea Hands-On Session
Introduction to Erlang/(Elixir) at a Webilea Hands-On SessionIntroduction to Erlang/(Elixir) at a Webilea Hands-On Session
Introduction to Erlang/(Elixir) at a Webilea Hands-On Session
 
Erlang For Five Nines
Erlang For Five NinesErlang For Five Nines
Erlang For Five Nines
 
Erlang from behing the trenches by Francesco Cesarini
Erlang from behing the trenches by Francesco CesariniErlang from behing the trenches by Francesco Cesarini
Erlang from behing the trenches by Francesco Cesarini
 
Erlang os
Erlang osErlang os
Erlang os
 
Erlang session1
Erlang session1Erlang session1
Erlang session1
 
Bootstrap |> Elixir - Easy fun for busy developers
Bootstrap |> Elixir - Easy fun for busy developersBootstrap |> Elixir - Easy fun for busy developers
Bootstrap |> Elixir - Easy fun for busy developers
 
Oracle china campus recruitment ben xu
Oracle china campus recruitment ben xuOracle china campus recruitment ben xu
Oracle china campus recruitment ben xu
 
Erlang Message Passing Concurrency, For The Win
Erlang  Message  Passing  Concurrency,  For  The  WinErlang  Message  Passing  Concurrency,  For  The  Win
Erlang Message Passing Concurrency, For The Win
 
Elixir introduction
Elixir introductionElixir introduction
Elixir introduction
 
Mule Meetup Hyderabad
Mule Meetup HyderabadMule Meetup Hyderabad
Mule Meetup Hyderabad
 
Introducing Elixir and OTP at the Erlang BASH
Introducing Elixir and OTP at the Erlang BASHIntroducing Elixir and OTP at the Erlang BASH
Introducing Elixir and OTP at the Erlang BASH
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Recently uploaded (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Erlang Workshop

  • 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 milliseconds Soft 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 as External 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 $ erl Erlang R14B01 (erts-5.8.2) [...] Eshell V5.8.2 (abort with ^G) 1> 2 + 3. 5 2> [1, 2, 3] ++ [4, 5, 6]. [1,2,3,4,5,6] © 2011 Erlang Solutions Ltd.
  • 8. The Erlang Shell 3> A = test. test 4> B = {“string”, A}. {“string”,test} 5> {S, test} = B. {“string”,test} 6> S. © 2011 Erlang Solutions Ltd.
  • 9. The Erlang Shell 7> [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 & Functions 9> c(demo). {ok,demo} 10> demo:double(21). 42 11> demo:times(3, 3). ** exception error: undefined function demo: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.org http://learnyousomeerlang.com © 1999-2011 Erlang Solutions Ltd.
  • 40. Thank you! adam@erlang-solutions.com @eproxus © 1999-2011 Erlang Solutions Ltd.

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. 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
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n