SlideShare a Scribd company logo
Introduc)on to Erlang 
          Abd El‐Fa3ah Hussein Mahran 
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
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
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
Erlang is Concurrent functional
         programming language

It was designed by Ericsson to support distributed, fault-tolerant,
soft-real-time, and non-stop applications
Erlang Features
    Concurrency
    Fault tolerance
    Soft Real-Time
    Distribution
    Hot Code Loading
    External Interfaces
    Platform Independent
Erlang/OTP and design patterns

    Gen_Server Behaviour
    Gen_Fsm Behaviour
    Gen_Event Behaviour
    Supervisor Behaviour
    Releases
    Target systems
Tools applications
    Dialyzer
    Eunit
    Edoc
    Common_test
    Test_server
    Jinterface
    Erl_interface
                      Depending on
    wx
                     C++ WXwidgets
    Ssh
    Ssl
    xmerl
Applications written in Erlang
Applications written in Erlang
    Ericsson Company                                          Netkit Solutions (Network Equipment Monitoring
                                                                and Operations Support Systems)
    Bluetail/Alteon/Nortel (distributed, fault tolerant
     email system, SSL accelerator)                            Process-one (Jabber Messaging)

    Cellpoint (Location-based Mobile Services)                Schlund + Partner (Messaging and Interactive
                                                                Voice Response services)
    Corelatus (SS7 monitoring).
                                                               Quviq (Software Test Tool)
    dqdp.net (in Latvian) (Web Services).
                                                               RabbitMQ (AMQP Enterprise Messaging)
    Facebook (Facebook chat backend)
                                                               T-Mobile (previously one2one) (advanced call
    Finnish Meteorological Institute (Data acquisition         control services)
     and real-time monitoring)
                                                               Telia (a telecomms operator)
    IDT corp. (Real-time least-cost routing expert
     systems)                                                  Vail Systems (Interactive Voice Response
                                                                systems)
    Kreditor (Electronic payment systems)
                                                               Wavenet (SS7 and IVR applications)
    Mobilearts (GSM and UMTS services)
Erlang IDEs
    Eclipse (ErlIDE plugin)
    NetBeans (ErlyBird)
    Emacs
    VIM
    Any other editor (Gedit, Notepad++)
Erlang syntax
    Data types
    If statement
    Case statement
    Functions
    Modules
    Hello World program
    How Erlang works
Data types
    Number
        Integer 12, 43
        Float    34.3
    Atoms       create, remove
    Binaries <<“hello”>>
                                      Erlang don’t have
    Reference                         boolean as data
    Fun                             type, instead Erlang
    Port Identifier                 has true and false
    Pid    <0,36,0>
    Tuple {1, 2, 3}
    List    [1, 2, 3, 4]
    String “hello”
    Record -record(person, {name, age, phone}).
If statement
if
  GuardSeq1 ->
      Body1;
  ...;
  GuardSeqN ->
      BodyN
end.
Case Statement
case Expr of
  Pattern1 [when GuardSeq1]->
       Body1;
  ...;
  PatternN [when GuardSeqN] ->
       BodyN
end.
Functions
Clause 1     Name(Pattern11,...,Pattern1N) [when GuardSeq1] ->
                 Body1;
             ...;
Clause 2     Name(PatternK1,...,PatternKN) [when GuardSeqK] ->
                 …..,
                 BodyK.

                                    Parameters
                                                   Conditions
      Function name



                            Body
Modules
-module(moduleName).

-export([func/0, func/1]).

func() ->
  foo(5),
  ….

func(A) ->
  foo(A),
  ….

foo(N) ->
  …,
  …,
  ...
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>
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
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).
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]).
How to get Erlang
    Erlang.org
    Download
    Documentation
    Trapexit.org
    Erlang Factory
    Erlang-Consulting
Demo
    Hot Code swapping
    Concurrency
    Fault tolerance
    Distributed application
Hot Code swapping
-module(changing_code).

-export([start/0, loop/0]).
                                               % Forces the use of
start() ->
                                                   loop/0 from
   spawn(changing_code, loop, []).
                                               the latest version of
loop() ->                                        changing_code
   receive
      switch ->
           changing_code:loop();
      hello ->
           io:format(“CAT Hackers ----1~n”),
           loop();
     Msg ->
           io:format(“~p~n”, [Msg]),
           loop(),
end.
Concurrency
portscan(Ip, From, To) when From < To ->
  io:format("Ports open for: ~p:~n", [Ip]),
  pforeach(fun(Port) -> scan(Ip,Port) end,lists:seq(From, To)).

scan(Ip, Port) ->
   case gen_tcp:connect(Ip,Port,[{active, false}, binary]) of
      {ok,P} ->
          gen_tcp:close(P),
             io:format("~p is open~n", [Port]);
          _ ->
             ok
   end.

pforeach(F, [H|T]) ->
          spawn(fun() -> F(H) end),
          pforeach(F, T);
pforeach(_ , []) ->
   ok.
Fault tolerance
init([]) ->
    AChild=
    {main_module,{main_module, start_link, []}, permanent,
    2000, worker, [main_module]},
    {ok,{{one_for_one, 1, 60}, [AChild]}}.
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
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.
References

    Erlang.org
    Trapexit.org
    Programming Erlang, Joe Armstong
    Wikipedia.com
Q&A
Thanks
Ad

More Related Content

What's hot (20)

Modules and ports in Verilog HDL
Modules and ports in Verilog HDLModules and ports in Verilog HDL
Modules and ports in Verilog HDL
anand hd
 
SiLLis: Simplified Language for Listener
SiLLis: Simplified Language for ListenerSiLLis: Simplified Language for Listener
SiLLis: Simplified Language for Listener
paolograssi
 
Platform-independent static binary code analysis using a meta-assembly language
Platform-independent static binary code analysis using a meta-assembly languagePlatform-independent static binary code analysis using a meta-assembly language
Platform-independent static binary code analysis using a meta-assembly language
zynamics GmbH
 
Crash course in verilog
Crash course in verilogCrash course in verilog
Crash course in verilog
Pantech ProLabs India Pvt Ltd
 
Vhdl programming
Vhdl programmingVhdl programming
Vhdl programming
Yogesh Mashalkar
 
Verilog Lecture4 2014
Verilog Lecture4 2014Verilog Lecture4 2014
Verilog Lecture4 2014
Béo Tú
 
VHDL CODES
VHDL CODES VHDL CODES
VHDL CODES
OmkarDarekar6
 
Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014
Béo Tú
 
Game development
Game developmentGame development
Game development
Asido_
 
Verilog HDL Training Course
Verilog HDL Training CourseVerilog HDL Training Course
Verilog HDL Training Course
Paul Laskowski
 
Experiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gatesExperiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gates
Ricardo Castro
 
System Verilog Tutorial - VHDL
System Verilog Tutorial - VHDLSystem Verilog Tutorial - VHDL
System Verilog Tutorial - VHDL
E2MATRIX
 
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Adam Lindberg
 
Eric Lafortune - ProGuard and DexGuard for optimization and protection
Eric Lafortune - ProGuard and DexGuard for optimization and protectionEric Lafortune - ProGuard and DexGuard for optimization and protection
Eric Lafortune - ProGuard and DexGuard for optimization and protection
GuardSquare
 
Verilog presentation final
Verilog presentation finalVerilog presentation final
Verilog presentation final
Ankur Gupta
 
VLSI & E-CAD Lab Manual
VLSI & E-CAD Lab ManualVLSI & E-CAD Lab Manual
VLSI & E-CAD Lab Manual
Amairullah Khan Lodhi
 
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streams
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streamsTech talks annual 2015 kirk pepperdine_ripping apart java 8 streams
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streams
TechTalks
 
ECAD lab manual
ECAD lab manualECAD lab manual
ECAD lab manual
Dr. Swaminathan Kathirvel
 
Trace-Checking CPS Properties: Bridging the Cyber-Physical Gap
Trace-Checking CPS Properties: Bridging the Cyber-Physical GapTrace-Checking CPS Properties: Bridging the Cyber-Physical Gap
Trace-Checking CPS Properties: Bridging the Cyber-Physical Gap
Lionel Briand
 
Verilog 語法教學
Verilog 語法教學 Verilog 語法教學
Verilog 語法教學
艾鍗科技
 
Modules and ports in Verilog HDL
Modules and ports in Verilog HDLModules and ports in Verilog HDL
Modules and ports in Verilog HDL
anand hd
 
SiLLis: Simplified Language for Listener
SiLLis: Simplified Language for ListenerSiLLis: Simplified Language for Listener
SiLLis: Simplified Language for Listener
paolograssi
 
Platform-independent static binary code analysis using a meta-assembly language
Platform-independent static binary code analysis using a meta-assembly languagePlatform-independent static binary code analysis using a meta-assembly language
Platform-independent static binary code analysis using a meta-assembly language
zynamics GmbH
 
Verilog Lecture4 2014
Verilog Lecture4 2014Verilog Lecture4 2014
Verilog Lecture4 2014
Béo Tú
 
Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014Verilog Lecture5 hust 2014
Verilog Lecture5 hust 2014
Béo Tú
 
Game development
Game developmentGame development
Game development
Asido_
 
Verilog HDL Training Course
Verilog HDL Training CourseVerilog HDL Training Course
Verilog HDL Training Course
Paul Laskowski
 
Experiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gatesExperiment write-vhdl-code-for-realize-all-logic-gates
Experiment write-vhdl-code-for-realize-all-logic-gates
Ricardo Castro
 
System Verilog Tutorial - VHDL
System Verilog Tutorial - VHDLSystem Verilog Tutorial - VHDL
System Verilog Tutorial - VHDL
E2MATRIX
 
Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011Erlang Workshop at Dyncon 2011
Erlang Workshop at Dyncon 2011
Adam Lindberg
 
Eric Lafortune - ProGuard and DexGuard for optimization and protection
Eric Lafortune - ProGuard and DexGuard for optimization and protectionEric Lafortune - ProGuard and DexGuard for optimization and protection
Eric Lafortune - ProGuard and DexGuard for optimization and protection
GuardSquare
 
Verilog presentation final
Verilog presentation finalVerilog presentation final
Verilog presentation final
Ankur Gupta
 
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streams
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streamsTech talks annual 2015 kirk pepperdine_ripping apart java 8 streams
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streams
TechTalks
 
Trace-Checking CPS Properties: Bridging the Cyber-Physical Gap
Trace-Checking CPS Properties: Bridging the Cyber-Physical GapTrace-Checking CPS Properties: Bridging the Cyber-Physical Gap
Trace-Checking CPS Properties: Bridging the Cyber-Physical Gap
Lionel Briand
 
Verilog 語法教學
Verilog 語法教學 Verilog 語法教學
Verilog 語法教學
艾鍗科技
 

Similar to Introduction To Erlang Final (20)

Sioux Hot-or-Not: Functional programming: unlocking the real power of multi-c...
Sioux Hot-or-Not: Functional programming: unlocking the real power of multi-c...Sioux Hot-or-Not: Functional programming: unlocking the real power of multi-c...
Sioux Hot-or-Not: Functional programming: unlocking the real power of multi-c...
siouxhotornot
 
Keynote joearmstrong
Keynote joearmstrongKeynote joearmstrong
Keynote joearmstrong
Sentifi
 
Erlang
ErlangErlang
Erlang
ESUG
 
Erlang OTP
Erlang OTPErlang OTP
Erlang OTP
Zvi Avraham
 
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
André Graf
 
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
l xf
 
Erlang, an overview
Erlang, an overviewErlang, an overview
Erlang, an overview
Patrick Huesler
 
Erlang real time
Erlang real timeErlang real time
Erlang real time
Akshar Desai
 
Erlang Developments: The Good, The Bad and The Ugly
Erlang Developments: The Good, The Bad and The UglyErlang Developments: The Good, The Bad and The Ugly
Erlang Developments: The Good, The Bad and The Ugly
enriquepazperez
 
Erlang in 10 minutes
Erlang in 10 minutesErlang in 10 minutes
Erlang in 10 minutes
Maria Stylianou
 
An introduction to erlang
An introduction to erlangAn introduction to erlang
An introduction to erlang
Mirko Bonadei
 
Java
JavaJava
Java
Ashen Disanayaka
 
Erlang
ErlangErlang
Erlang
mateuszzawisza
 
Erlang os
Erlang osErlang os
Erlang os
Pinche12345
 
Elixir
ElixirElixir
Elixir
Robert Brown
 
Erlang
ErlangErlang
Erlang
Aaron Spiegel
 
Erlang is not a city in Germany
Erlang is not a city in GermanyErlang is not a city in Germany
Erlang is not a city in Germany
momo-13
 
Reliable and Concurrent Software - Erlang
Reliable and Concurrent Software - ErlangReliable and Concurrent Software - Erlang
Reliable and Concurrent Software - Erlang
ssuser2637a1
 
The Erlang Programming Language
The Erlang Programming LanguageThe Erlang Programming Language
The Erlang Programming Language
Dennis Byrne
 
Java introduction
Java introductionJava introduction
Java introduction
Migrant Systems
 
Sioux Hot-or-Not: Functional programming: unlocking the real power of multi-c...
Sioux Hot-or-Not: Functional programming: unlocking the real power of multi-c...Sioux Hot-or-Not: Functional programming: unlocking the real power of multi-c...
Sioux Hot-or-Not: Functional programming: unlocking the real power of multi-c...
siouxhotornot
 
Keynote joearmstrong
Keynote joearmstrongKeynote joearmstrong
Keynote joearmstrong
Sentifi
 
Erlang
ErlangErlang
Erlang
ESUG
 
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
André Graf
 
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
l xf
 
Erlang Developments: The Good, The Bad and The Ugly
Erlang Developments: The Good, The Bad and The UglyErlang Developments: The Good, The Bad and The Ugly
Erlang Developments: The Good, The Bad and The Ugly
enriquepazperez
 
An introduction to erlang
An introduction to erlangAn introduction to erlang
An introduction to erlang
Mirko Bonadei
 
Erlang is not a city in Germany
Erlang is not a city in GermanyErlang is not a city in Germany
Erlang is not a city in Germany
momo-13
 
Reliable and Concurrent Software - Erlang
Reliable and Concurrent Software - ErlangReliable and Concurrent Software - Erlang
Reliable and Concurrent Software - Erlang
ssuser2637a1
 
The Erlang Programming Language
The Erlang Programming LanguageThe Erlang Programming Language
The Erlang Programming Language
Dennis Byrne
 
Ad

More from SinarShebl (8)

Infosec
InfosecInfosec
Infosec
SinarShebl
 
Cloud
CloudCloud
Cloud
SinarShebl
 
Pluggable Authentication Module
Pluggable Authentication ModulePluggable Authentication Module
Pluggable Authentication Module
SinarShebl
 
Scmp P & F
Scmp P & FScmp P & F
Scmp P & F
SinarShebl
 
Java Script Utilities
Java Script UtilitiesJava Script Utilities
Java Script Utilities
SinarShebl
 
All Bow To Open Solaris Crossbow H4ck3rz Due
All Bow To Open Solaris Crossbow H4ck3rz DueAll Bow To Open Solaris Crossbow H4ck3rz Due
All Bow To Open Solaris Crossbow H4ck3rz Due
SinarShebl
 
Fedora 11 Features and Installation
Fedora 11 Features and InstallationFedora 11 Features and Installation
Fedora 11 Features and Installation
SinarShebl
 
Google Docs
Google DocsGoogle Docs
Google Docs
SinarShebl
 
Pluggable Authentication Module
Pluggable Authentication ModulePluggable Authentication Module
Pluggable Authentication Module
SinarShebl
 
Java Script Utilities
Java Script UtilitiesJava Script Utilities
Java Script Utilities
SinarShebl
 
All Bow To Open Solaris Crossbow H4ck3rz Due
All Bow To Open Solaris Crossbow H4ck3rz DueAll Bow To Open Solaris Crossbow H4ck3rz Due
All Bow To Open Solaris Crossbow H4ck3rz Due
SinarShebl
 
Fedora 11 Features and Installation
Fedora 11 Features and InstallationFedora 11 Features and Installation
Fedora 11 Features and Installation
SinarShebl
 
Ad

Recently uploaded (20)

Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Markus Eisele
 
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
Ivano Malavolta
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
AI-proof your career by Olivier Vroom and David WIlliamson
AI-proof your career by Olivier Vroom and David WIlliamsonAI-proof your career by Olivier Vroom and David WIlliamson
AI-proof your career by Olivier Vroom and David WIlliamson
UXPA Boston
 
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
James Anderson
 
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
João Esperancinha
 
Mastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B LandscapeMastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B Landscape
marketing943205
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
Viam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdfViam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdf
camilalamoratta
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
IT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information TechnologyIT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information Technology
SHEHABALYAMANI
 
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptxTop 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
mkubeusa
 
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Raffi Khatchadourian
 
Building the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdfBuilding the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdf
Cheryl Hung
 
Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)
Kaya Weers
 
IT488 Wireless Sensor Networks_Information Technology
IT488 Wireless Sensor Networks_Information TechnologyIT488 Wireless Sensor Networks_Information Technology
IT488 Wireless Sensor Networks_Information Technology
SHEHABALYAMANI
 
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à GenèveUiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPathCommunity
 
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent LasterAI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
All Things Open
 
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Enterprise Integration Is Dead! Long Live AI-Driven Integration with Apache C...
Markus Eisele
 
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
Ivano Malavolta
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
AI-proof your career by Olivier Vroom and David WIlliamson
AI-proof your career by Olivier Vroom and David WIlliamsonAI-proof your career by Olivier Vroom and David WIlliamson
AI-proof your career by Olivier Vroom and David WIlliamson
UXPA Boston
 
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
GDG Cloud Southlake #42: Suresh Mathew: Autonomous Resource Optimization: How...
James Anderson
 
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
Could Virtual Threads cast away the usage of Kotlin Coroutines - DevoxxUK2025
João Esperancinha
 
Mastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B LandscapeMastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B Landscape
marketing943205
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
Viam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdfViam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdf
camilalamoratta
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
IT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information TechnologyIT484 Cyber Forensics_Information Technology
IT484 Cyber Forensics_Information Technology
SHEHABALYAMANI
 
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptxTop 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
mkubeusa
 
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Challenges in Migrating Imperative Deep Learning Programs to Graph Execution:...
Raffi Khatchadourian
 
Building the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdfBuilding the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdf
Cheryl Hung
 
Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)
Kaya Weers
 
IT488 Wireless Sensor Networks_Information Technology
IT488 Wireless Sensor Networks_Information TechnologyIT488 Wireless Sensor Networks_Information Technology
IT488 Wireless Sensor Networks_Information Technology
SHEHABALYAMANI
 
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à GenèveUiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPathCommunity
 
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent LasterAI 3-in-1: Agents, RAG, and Local Models - Brent Laster
AI 3-in-1: Agents, RAG, and Local Models - Brent Laster
All Things Open
 

Introduction To Erlang Final

  • 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
  • 7. Erlang/OTP and design patterns   Gen_Server Behaviour   Gen_Fsm Behaviour   Gen_Event Behaviour   Supervisor Behaviour   Releases   Target systems
  • 8. Tools applications   Dialyzer   Eunit   Edoc   Common_test   Test_server   Jinterface   Erl_interface Depending on   wx C++ WXwidgets   Ssh   Ssl   xmerl
  • 10. Applications written in Erlang   Ericsson Company   Netkit Solutions (Network Equipment Monitoring and Operations Support Systems)   Bluetail/Alteon/Nortel (distributed, fault tolerant email system, SSL accelerator)   Process-one (Jabber Messaging)   Cellpoint (Location-based Mobile Services)   Schlund + Partner (Messaging and Interactive Voice Response services)   Corelatus (SS7 monitoring).   Quviq (Software Test Tool)   dqdp.net (in Latvian) (Web Services).   RabbitMQ (AMQP Enterprise Messaging)   Facebook (Facebook chat backend)   T-Mobile (previously one2one) (advanced call   Finnish Meteorological Institute (Data acquisition control services) and real-time monitoring)   Telia (a telecomms operator)   IDT corp. (Real-time least-cost routing expert systems)   Vail Systems (Interactive Voice Response systems)   Kreditor (Electronic payment systems)   Wavenet (SS7 and IVR applications)   Mobilearts (GSM and UMTS services)
  • 11. Erlang IDEs   Eclipse (ErlIDE plugin)   NetBeans (ErlyBird)   Emacs   VIM   Any other editor (Gedit, Notepad++)
  • 12. Erlang syntax   Data types   If statement   Case statement   Functions   Modules   Hello World program   How Erlang works
  • 13. Data types   Number   Integer 12, 43   Float 34.3   Atoms create, remove   Binaries <<“hello”>> Erlang don’t have   Reference boolean as data   Fun type, instead Erlang   Port Identifier has true and false   Pid <0,36,0>   Tuple {1, 2, 3}   List [1, 2, 3, 4]   String “hello”   Record -record(person, {name, age, phone}).
  • 14. If statement if GuardSeq1 -> Body1; ...; GuardSeqN -> BodyN end.
  • 15. Case Statement case Expr of Pattern1 [when GuardSeq1]-> Body1; ...; PatternN [when GuardSeqN] -> BodyN end.
  • 16. Functions Clause 1 Name(Pattern11,...,Pattern1N) [when GuardSeq1] -> Body1; ...; Clause 2 Name(PatternK1,...,PatternKN) [when GuardSeqK] -> ….., BodyK. Parameters Conditions Function name Body
  • 17. Modules -module(moduleName). -export([func/0, func/1]). func() -> foo(5), …. func(A) -> foo(A), …. foo(N) -> …, …, ...
  • 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
  • 23. Demo   Hot Code swapping   Concurrency   Fault tolerance   Distributed application
  • 24. Hot Code swapping -module(changing_code). -export([start/0, loop/0]). % Forces the use of start() -> loop/0 from spawn(changing_code, loop, []). the latest version of loop() -> changing_code receive switch -> changing_code:loop(); hello -> io:format(“CAT Hackers ----1~n”), loop(); Msg -> io:format(“~p~n”, [Msg]), loop(), end.
  • 25. Concurrency portscan(Ip, From, To) when From < To -> io:format("Ports open for: ~p:~n", [Ip]), pforeach(fun(Port) -> scan(Ip,Port) end,lists:seq(From, To)). scan(Ip, Port) -> case gen_tcp:connect(Ip,Port,[{active, false}, binary]) of {ok,P} -> gen_tcp:close(P), io:format("~p is open~n", [Port]); _ -> ok end. pforeach(F, [H|T]) -> spawn(fun() -> F(H) end), pforeach(F, T); pforeach(_ , []) -> ok.
  • 26. Fault tolerance init([]) -> AChild= {main_module,{main_module, start_link, []}, permanent, 2000, worker, [main_module]}, {ok,{{one_for_one, 1, 60}, [AChild]}}.
  • 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.
  • 29. References   Erlang.org   Trapexit.org   Programming Erlang, Joe Armstong   Wikipedia.com
  • 30. Q&A
  翻译: