SlideShare a Scribd company logo
1 of 36
Download to read offline
The Erlang Ecosystem
Robert Virding
www.erlang-solutions.com
Background: the problem
‣Ericsson’s “best seller” AXE
telephone exchanges
(switches) required large
effort to develop and maintain
software.
‣The problem to solve was how
to make programming these
types of applications easier,
but keeping the same
characteristics.
www.erlang-solutions.com
3
‣Handle a very large numbers of concurrent activities.
‣Actions must be performed at a certain point in time or within a certain time.
‣System distributed over several computers.
‣Interaction with hardware.
‣Very large software systems.
‣Complex functionality such as feature interaction.
‣Continuous operation over many years.
‣Software maintenance (reconfiguration etc.) without stopping the system.
‣Stringent quality and reliability requirements.
‣Fault tolerance both to hardware failures and software errors.
Bjarne Däcker, November 2000 - Licentiate Thesis
Background: problem domain
‣Handle a very large numbers of concurrent activities.
‣Actions must be performed at a certain point in time or within a certain time.
‣System distributed over several computers.
‣Interaction with hardware.
‣Very large software systems.
‣Complex functionality such as feature interaction.
‣Continuous operation over many years.
‣Software maintenance (reconfiguration etc.) without stopping the system.
‣Stringent quality and reliability requirements.
‣Fault tolerance both to hardware failures and software errors.
Bjarne Däcker, November 2000 - Licentiate Thesis
Not just telecom
www.erlang-solutions.com
4
Background: some reflections
WE WERE TRYING TO SOLVE THE
PROBLEM
We were not out to implement the actor model
We were not out to implement a functional language
www.erlang-solutions.com
5
Background: some reflections
The language/system

evolved to solve the problem
‣We had a clear set of criteria for what should go into
the language/system
▹ Was it useful?
▹ Did it or did it not help build the system?
‣This made the development of the language/system
very focused
www.erlang-solutions.com
6
Erlang and the system around it was designed
to solve this type of problem
Erlang/OTP provides direct support for these
issues
Background
www.erlang-solutions.com
7
▸ Lightweight concurrency
▹ Must handle a large number of processes
▹ Process creation, context switching and inter-process communication must be
cheap and fast.
▸ Asynchronous communication
▸ Process isolation
▹ What happens in one process must not affect any other process.
▸ Error handling
▹ The system must be able to detect and handle errors.
▸ Continuous evolution of the system
▹ We want to upgrade the system while running and with no loss of service.
First Principles
www.erlang-solutions.com
8
Also
▸ High level language to get real benefits.
▸ The language/system should be simple
▹ Simple in the sense that there should be a small number of basic principles, if
these are right then the language will be powerful but easy to comprehend and
use. Small is good.
▹ The language should be simple to understand and program.
▸ Provide tools for building systems, not solutions
▹ We would provide the basic operations needed for building communication
protocols and error handling
First Principles
www.erlang-solutions.com
9
Hard at work developing Erlang
10
▸Simple functional language
▹ With a “different” syntax
▸It is safe!
▹ For example no pointer errors
▸It is reasonably high-level
▹ At least then it was
▹ Still is in many ways
▸Dynamically typed!
▹ No user defined data-types!
Sequential Language
11
▸Typical features of functional languages
▹ Immutable data
▹ Immutable variables
▹ Extensive use of pattern matching
▹ Recursion rules!
Sequential Language
12
<< IpVers:4, HdrLen:4, SrvcType:8, TotLen:16,
ID:16, Flags:3, FragOff:13,
TTL:8, Proto:8, HdrChkSum:16,
SrcIP:32, DestIP:32,
RestDgram/binary >>
▸ IP datagram of IP protocol version 4
Sequential Language: high-level binaries
13
Mike Williams:
“three properties of a programming language are central to the
efficient operation of a concurrent language or operating system.
These are: 1) the time to create a process. 2) the time to perform a
context switch between two different processes and 3) the time to
copy a message between two processes.
The performance of any highly-concurrent system is dominated by
these three times.”
Concurrency
14
▸Light-weight processes
▹ Millions of Erlang processes possible on one machine
▸Asynchronous message passing
▹ Only method of communication between processes
▹ Necessary for non-blocking systems
▹ Provide basic mechanism
▹ Very cheap
▸Selective receive mechanism
▹ Allows us to ignore messages which are uninteresting now
▸Processes are isolated!
▸NO GLOBAL DATA!
Concurrency: core ideas
www.erlang-solutions.com
15
Error Handling: basic premise
ERRORS WILL ALWAYS OCCUR!
www.erlang-solutions.com
16
Error Handling: basic goal
THE SYSTEM MUST NEVER GO DOWN!
Parts may crash and burn
BUT
The system must never go down!
17
Robust systems must always be aware of errors
BUT
Want to avoid writing error checking code everywhere
Want to be able to handle process crashes among cooperating
processes
Interact well with process communication
Error Handling
18
We just want to
Error Handling
Let it crash!
19
▸Process based
▸If one process crashes then all cooperating processes should
crash
▹ Cooperating processes are linked together
▹ Process crashes propagate exit signals along links
▹ A process receiving an exit signal crashes
▸”System” processes can monitor them and restart them when
necessary by trapping exits
▹ exit signals are converted to messages in the process message queue
▹ the process does not crash
▸But sometimes we do need to handle errors locally
Error Handling
20
How do you build robust systems?
▸At least you need to ensure
▹ Necessary functionality is always available
▹ System cleans up when things go wrong
▸Must have at least two machines!
▹ Need distribution
Robust Systems
21
Supervision trees
▸Supervisors will start child processes
▹ Workers
▹ Supervisors
▸Supervisors will monitor

their children
▹ Through links and trapping exits
▸Supervisors can restart the

children when they terminate
Robust Systems: necessary functionality
Supervisors
Workers
22
Monitor processes
▸Servers monitoring clients
▹ Clean-up after then if they crash
▸Processes monitoring co-workers
▸Groups of co-workers dying together
Robust Systems: system cleanup
23
▸A set of design patterns for building concurrent, fault
tolerant systems
▸Generic behaviours
▹ Implement the design patterns
▹ Extensible to support new patterns
▸Libraries
▸Support tools for building systems/releases
OTP (Open Telecom Platform)
There is nothing about telecoms
in OTP!
24
Systems built with Erlang tend to
be very OS like
▸Provides services
▸Very seldom a central thread of execution
▹ At most something which starts “tasks”
Systems
25
What is the BEAM?
A virtual machine to run Erlang
26
▸ Lightweight, massive concurrency
▸ Asynchronous communication
▸ Process isolation
▸ Error handling
▸ Continuous evolution of the system
▸ Soft real-time
▸ Transparent SMP/multi-core support
▸ Interfaces to the outside world
These we seldom have to worry about directly in a language,

except for receiving messages
Properties of the BEAM
27
▸ Immutable data
▸ Predefined set of data types
▸ Pattern matching
▸ Functional language
▸ Modules/code
▸ No global data
These are what we mainly "see" directly in our languages
Properties of the BEAM
Erlang Ecosystem
28
Languages built/running on
top of the BEAM, Erlang and
OTP.
By following “the rules” the
languages openly interact with,
and support, each other
making the whole system more
powerful than any individual
language can ever be.
Erlang Ecosystem
29
The whole system can
interact with other
systems
30
Extending the system
31
▸ Languages which keep the basic Erlang execution model and data
types
▹ New syntax
▹ Different “packaging”
▸ Elixir
▸ LFE (Lisp Flavoured Erlang
▸ Languages which extend the Erlang execution model and data
types
▸ Lua
▸ Prolog
Extending the system: new skin for the old ceremony
32
The thickness of the skin affects how efficiently the new language
can be implemented and how seamlessly it can interact
Extending the system: new skin for the old ceremony
ERLANG BEAM
OTP
OTP
Erlang
New Language
New Language libraries
33
▸“Elixir is a dynamic, functional language designed for
building scalable and maintainable applications.”
▸“Elixir is influenced by Ruby”
▹ “Elixir is NOT Ruby on the Erlang VM”
▸Elixir has meta programming capabilities using macros
▸Many libraries and interfaces standardised, rewritten and
extended
▸Comes with extensive set of build tools
Elixir
Thin skin
34
▸"LFE, Lisp Flavoured Erlang, is a lisp syntax front-end to the
Erlang system"
▸It's a real Lisp
▸Provides lots of lisp goodies
▹ Real homoiconicity and macros (yay!)
▸Seamlessly interacts with vanilla Erlang/OTP
▹ Be able to freely mix vanilla code and LFE code
▸Small core language
LFE (Lisp Flavoured Erlang)
Thin skin
35
▸"Lua is a powerful, efficient, lightweight, embeddable
scripting language. It supports procedural programming,
object-oriented programming, functional programming,
data-driven programming, and data description."
▸Implements Lua 5.2
▹ All of it!
▸Shared, mutable, global data
▸Lua handling of code
▸...
Lua
Thick skin
Robert Virding
rvirding@gmail.com
robert.virding@erlang-solutions.com
@rvirding

More Related Content

What's hot

What's hot (13)

Parallel and Asynchronous Programming - ITProDevConnections 2012 (English)
Parallel and Asynchronous Programming -  ITProDevConnections 2012 (English)Parallel and Asynchronous Programming -  ITProDevConnections 2012 (English)
Parallel and Asynchronous Programming - ITProDevConnections 2012 (English)
 
Devops at Netflix (re:Invent)
Devops at Netflix (re:Invent)Devops at Netflix (re:Invent)
Devops at Netflix (re:Invent)
 
How Parse Built a Mobile Backend as a Service on AWS (MBL307) | AWS re:Invent...
How Parse Built a Mobile Backend as a Service on AWS (MBL307) | AWS re:Invent...How Parse Built a Mobile Backend as a Service on AWS (MBL307) | AWS re:Invent...
How Parse Built a Mobile Backend as a Service on AWS (MBL307) | AWS re:Invent...
 
CQRS Evolved - CQRS + Akka.NET
CQRS Evolved - CQRS + Akka.NETCQRS Evolved - CQRS + Akka.NET
CQRS Evolved - CQRS + Akka.NET
 
Akka.net versus microsoft orleans
Akka.net versus microsoft orleansAkka.net versus microsoft orleans
Akka.net versus microsoft orleans
 
Intro to elixir and phoenix
Intro to elixir and phoenixIntro to elixir and phoenix
Intro to elixir and phoenix
 
Python Raster Function - Esri Developer Conference - 2015
Python Raster Function - Esri Developer Conference - 2015Python Raster Function - Esri Developer Conference - 2015
Python Raster Function - Esri Developer Conference - 2015
 
The Actor Model - Towards Better Concurrency
The Actor Model - Towards Better ConcurrencyThe Actor Model - Towards Better Concurrency
The Actor Model - Towards Better Concurrency
 
Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1Introduction to the intermediate Python - v1.1
Introduction to the intermediate Python - v1.1
 
High Performance Systems in Go - GopherCon 2014
High Performance Systems in Go - GopherCon 2014High Performance Systems in Go - GopherCon 2014
High Performance Systems in Go - GopherCon 2014
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudy
 
Migrating big data
Migrating big dataMigrating big data
Migrating big data
 
Go Reactive: Event-Driven, Scalable, Resilient & Responsive Systems
Go Reactive: Event-Driven, Scalable, Resilient & Responsive SystemsGo Reactive: Event-Driven, Scalable, Resilient & Responsive Systems
Go Reactive: Event-Driven, Scalable, Resilient & Responsive Systems
 

Similar to FunctionalConf '16 Robert Virding Erlang Ecosystem

Operating systems
Operating systemsOperating systems
Operating systems
anishgoel
 
Web Quest Of Operating Systems
Web Quest Of Operating SystemsWeb Quest Of Operating Systems
Web Quest Of Operating Systems
LAMMYY
 
Joe armstrong erlanga_languageforprogrammingreliablesystems
Joe armstrong erlanga_languageforprogrammingreliablesystemsJoe armstrong erlanga_languageforprogrammingreliablesystems
Joe armstrong erlanga_languageforprogrammingreliablesystems
Sentifi
 

Similar to FunctionalConf '16 Robert Virding Erlang Ecosystem (20)

Wherefore art thou Erlang?, OW2con'18, June 7-8, 2018, Paris
Wherefore art thou Erlang?, OW2con'18, June 7-8, 2018, ParisWherefore art thou Erlang?, OW2con'18, June 7-8, 2018, Paris
Wherefore art thou Erlang?, OW2con'18, June 7-8, 2018, Paris
 
Learning Elixir as a Rubyist
Learning Elixir as a RubyistLearning Elixir as a Rubyist
Learning Elixir as a Rubyist
 
Epc 3.ppt
Epc 3.pptEpc 3.ppt
Epc 3.ppt
 
Pilgrim's Progress to the Promised Land by Robert Virding
Pilgrim's Progress to the Promised Land by Robert VirdingPilgrim's Progress to the Promised Land by Robert Virding
Pilgrim's Progress to the Promised Land by Robert Virding
 
Operating systems
Operating systemsOperating systems
Operating systems
 
Computer Languages
Computer Languages Computer Languages
Computer Languages
 
Web Quest Of Operating Systems
Web Quest Of Operating SystemsWeb Quest Of Operating Systems
Web Quest Of Operating Systems
 
os_1.pdf
os_1.pdfos_1.pdf
os_1.pdf
 
Simplifying debugging for multi-core Linux devices and low-power Linux clusters
Simplifying debugging for multi-core Linux devices and low-power Linux clusters Simplifying debugging for multi-core Linux devices and low-power Linux clusters
Simplifying debugging for multi-core Linux devices and low-power Linux clusters
 
system software and application software
system software and application softwaresystem software and application software
system software and application software
 
Shamsa altayer
Shamsa altayerShamsa altayer
Shamsa altayer
 
Open shmem
Open shmemOpen shmem
Open shmem
 
Richa garg itm
Richa garg itmRicha garg itm
Richa garg itm
 
Joe armstrong erlanga_languageforprogrammingreliablesystems
Joe armstrong erlanga_languageforprogrammingreliablesystemsJoe armstrong erlanga_languageforprogrammingreliablesystems
Joe armstrong erlanga_languageforprogrammingreliablesystems
 
Computer software part 1
Computer software part 1Computer software part 1
Computer software part 1
 
Operating system
Operating systemOperating system
Operating system
 
Unit 1_Operating system
Unit 1_Operating system Unit 1_Operating system
Unit 1_Operating system
 
Old Is the New New
Old Is the New NewOld Is the New New
Old Is the New New
 
Computer Software
Computer SoftwareComputer Software
Computer Software
 
Let it crash! The Erlang Approach to Building Reliable Services
Let it crash! The Erlang Approach to Building Reliable ServicesLet it crash! The Erlang Approach to Building Reliable Services
Let it crash! The Erlang Approach to Building Reliable Services
 

Recently uploaded

Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
imonikaupta
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
Diya Sharma
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
shivangimorya083
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
SofiyaSharma5
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 

Recently uploaded (20)

VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
₹5.5k {Cash Payment}New Friends Colony Call Girls In [Delhi NIHARIKA] 🔝|97111...
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
 

FunctionalConf '16 Robert Virding Erlang Ecosystem

  • 2. www.erlang-solutions.com Background: the problem ‣Ericsson’s “best seller” AXE telephone exchanges (switches) required large effort to develop and maintain software. ‣The problem to solve was how to make programming these types of applications easier, but keeping the same characteristics.
  • 3. www.erlang-solutions.com 3 ‣Handle a very large numbers of concurrent activities. ‣Actions must be performed at a certain point in time or within a certain time. ‣System distributed over several computers. ‣Interaction with hardware. ‣Very large software systems. ‣Complex functionality such as feature interaction. ‣Continuous operation over many years. ‣Software maintenance (reconfiguration etc.) without stopping the system. ‣Stringent quality and reliability requirements. ‣Fault tolerance both to hardware failures and software errors. Bjarne Däcker, November 2000 - Licentiate Thesis Background: problem domain ‣Handle a very large numbers of concurrent activities. ‣Actions must be performed at a certain point in time or within a certain time. ‣System distributed over several computers. ‣Interaction with hardware. ‣Very large software systems. ‣Complex functionality such as feature interaction. ‣Continuous operation over many years. ‣Software maintenance (reconfiguration etc.) without stopping the system. ‣Stringent quality and reliability requirements. ‣Fault tolerance both to hardware failures and software errors. Bjarne Däcker, November 2000 - Licentiate Thesis Not just telecom
  • 4. www.erlang-solutions.com 4 Background: some reflections WE WERE TRYING TO SOLVE THE PROBLEM We were not out to implement the actor model We were not out to implement a functional language
  • 5. www.erlang-solutions.com 5 Background: some reflections The language/system
 evolved to solve the problem ‣We had a clear set of criteria for what should go into the language/system ▹ Was it useful? ▹ Did it or did it not help build the system? ‣This made the development of the language/system very focused
  • 6. www.erlang-solutions.com 6 Erlang and the system around it was designed to solve this type of problem Erlang/OTP provides direct support for these issues Background
  • 7. www.erlang-solutions.com 7 ▸ Lightweight concurrency ▹ Must handle a large number of processes ▹ Process creation, context switching and inter-process communication must be cheap and fast. ▸ Asynchronous communication ▸ Process isolation ▹ What happens in one process must not affect any other process. ▸ Error handling ▹ The system must be able to detect and handle errors. ▸ Continuous evolution of the system ▹ We want to upgrade the system while running and with no loss of service. First Principles
  • 8. www.erlang-solutions.com 8 Also ▸ High level language to get real benefits. ▸ The language/system should be simple ▹ Simple in the sense that there should be a small number of basic principles, if these are right then the language will be powerful but easy to comprehend and use. Small is good. ▹ The language should be simple to understand and program. ▸ Provide tools for building systems, not solutions ▹ We would provide the basic operations needed for building communication protocols and error handling First Principles
  • 10. 10 ▸Simple functional language ▹ With a “different” syntax ▸It is safe! ▹ For example no pointer errors ▸It is reasonably high-level ▹ At least then it was ▹ Still is in many ways ▸Dynamically typed! ▹ No user defined data-types! Sequential Language
  • 11. 11 ▸Typical features of functional languages ▹ Immutable data ▹ Immutable variables ▹ Extensive use of pattern matching ▹ Recursion rules! Sequential Language
  • 12. 12 << IpVers:4, HdrLen:4, SrvcType:8, TotLen:16, ID:16, Flags:3, FragOff:13, TTL:8, Proto:8, HdrChkSum:16, SrcIP:32, DestIP:32, RestDgram/binary >> ▸ IP datagram of IP protocol version 4 Sequential Language: high-level binaries
  • 13. 13 Mike Williams: “three properties of a programming language are central to the efficient operation of a concurrent language or operating system. These are: 1) the time to create a process. 2) the time to perform a context switch between two different processes and 3) the time to copy a message between two processes. The performance of any highly-concurrent system is dominated by these three times.” Concurrency
  • 14. 14 ▸Light-weight processes ▹ Millions of Erlang processes possible on one machine ▸Asynchronous message passing ▹ Only method of communication between processes ▹ Necessary for non-blocking systems ▹ Provide basic mechanism ▹ Very cheap ▸Selective receive mechanism ▹ Allows us to ignore messages which are uninteresting now ▸Processes are isolated! ▸NO GLOBAL DATA! Concurrency: core ideas
  • 15. www.erlang-solutions.com 15 Error Handling: basic premise ERRORS WILL ALWAYS OCCUR!
  • 16. www.erlang-solutions.com 16 Error Handling: basic goal THE SYSTEM MUST NEVER GO DOWN! Parts may crash and burn BUT The system must never go down!
  • 17. 17 Robust systems must always be aware of errors BUT Want to avoid writing error checking code everywhere Want to be able to handle process crashes among cooperating processes Interact well with process communication Error Handling
  • 18. 18 We just want to Error Handling Let it crash!
  • 19. 19 ▸Process based ▸If one process crashes then all cooperating processes should crash ▹ Cooperating processes are linked together ▹ Process crashes propagate exit signals along links ▹ A process receiving an exit signal crashes ▸”System” processes can monitor them and restart them when necessary by trapping exits ▹ exit signals are converted to messages in the process message queue ▹ the process does not crash ▸But sometimes we do need to handle errors locally Error Handling
  • 20. 20 How do you build robust systems? ▸At least you need to ensure ▹ Necessary functionality is always available ▹ System cleans up when things go wrong ▸Must have at least two machines! ▹ Need distribution Robust Systems
  • 21. 21 Supervision trees ▸Supervisors will start child processes ▹ Workers ▹ Supervisors ▸Supervisors will monitor
 their children ▹ Through links and trapping exits ▸Supervisors can restart the
 children when they terminate Robust Systems: necessary functionality Supervisors Workers
  • 22. 22 Monitor processes ▸Servers monitoring clients ▹ Clean-up after then if they crash ▸Processes monitoring co-workers ▸Groups of co-workers dying together Robust Systems: system cleanup
  • 23. 23 ▸A set of design patterns for building concurrent, fault tolerant systems ▸Generic behaviours ▹ Implement the design patterns ▹ Extensible to support new patterns ▸Libraries ▸Support tools for building systems/releases OTP (Open Telecom Platform) There is nothing about telecoms in OTP!
  • 24. 24 Systems built with Erlang tend to be very OS like ▸Provides services ▸Very seldom a central thread of execution ▹ At most something which starts “tasks” Systems
  • 25. 25 What is the BEAM? A virtual machine to run Erlang
  • 26. 26 ▸ Lightweight, massive concurrency ▸ Asynchronous communication ▸ Process isolation ▸ Error handling ▸ Continuous evolution of the system ▸ Soft real-time ▸ Transparent SMP/multi-core support ▸ Interfaces to the outside world These we seldom have to worry about directly in a language,
 except for receiving messages Properties of the BEAM
  • 27. 27 ▸ Immutable data ▸ Predefined set of data types ▸ Pattern matching ▸ Functional language ▸ Modules/code ▸ No global data These are what we mainly "see" directly in our languages Properties of the BEAM
  • 28. Erlang Ecosystem 28 Languages built/running on top of the BEAM, Erlang and OTP. By following “the rules” the languages openly interact with, and support, each other making the whole system more powerful than any individual language can ever be.
  • 29. Erlang Ecosystem 29 The whole system can interact with other systems
  • 31. 31 ▸ Languages which keep the basic Erlang execution model and data types ▹ New syntax ▹ Different “packaging” ▸ Elixir ▸ LFE (Lisp Flavoured Erlang ▸ Languages which extend the Erlang execution model and data types ▸ Lua ▸ Prolog Extending the system: new skin for the old ceremony
  • 32. 32 The thickness of the skin affects how efficiently the new language can be implemented and how seamlessly it can interact Extending the system: new skin for the old ceremony ERLANG BEAM OTP OTP Erlang New Language New Language libraries
  • 33. 33 ▸“Elixir is a dynamic, functional language designed for building scalable and maintainable applications.” ▸“Elixir is influenced by Ruby” ▹ “Elixir is NOT Ruby on the Erlang VM” ▸Elixir has meta programming capabilities using macros ▸Many libraries and interfaces standardised, rewritten and extended ▸Comes with extensive set of build tools Elixir Thin skin
  • 34. 34 ▸"LFE, Lisp Flavoured Erlang, is a lisp syntax front-end to the Erlang system" ▸It's a real Lisp ▸Provides lots of lisp goodies ▹ Real homoiconicity and macros (yay!) ▸Seamlessly interacts with vanilla Erlang/OTP ▹ Be able to freely mix vanilla code and LFE code ▸Small core language LFE (Lisp Flavoured Erlang) Thin skin
  • 35. 35 ▸"Lua is a powerful, efficient, lightweight, embeddable scripting language. It supports procedural programming, object-oriented programming, functional programming, data-driven programming, and data description." ▸Implements Lua 5.2 ▹ All of it! ▸Shared, mutable, global data ▸Lua handling of code ▸... Lua Thick skin