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

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 

Recently uploaded (20)

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

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