SlideShare uma empresa Scribd logo
1 de 17
Baixar para ler offline
AN INTRODUCTION TO
ERLANG AND ELIXIR
Wednesday, September 25, 13
WHAT IS ERLANG
Modular, Declarative Language who’s syntax descends from
prolog
Wednesday, September 25, 13
WHAT IS ELIXIR
Modular, Declarative language with meta programming
facilities whose syntax descends (mostly) from Ruby
Wednesday, September 25, 13
ERLANG VM - WHY SO
INTERESTING
Built Around Concurrency
Built in scheduler
Async IO
Concurrent Garbage collector
Wednesday, September 25, 13
ERLANG VM - WHY SO
INTERESTING
Small Number of Serializable Types
Pattern Matching
Processes
Process Linking
Immutable Data
Wednesday, September 25, 13
ERLANG VM
Erlang
Elixir
Joxa
LFE
The Concurrent Schemer
Reia
Wednesday, September 25, 13
ERLANG VM - TYPES
Numbers
Atoms
Bit Strings and Binaries
Fun
Tuple
List
Wednesday, September 25, 13
ERLANG VM -
FEATURES
Expressions
Functions
Modules
Process
Wednesday, September 25, 13
RECORDS - ERLANG
-module(records).
-record(robot, {name,
type=industrial,
hobbies,
details=[]}).
first_robot() ->
#robot{name="Mechatron",
type=handmade,
details=["Moved by a small man inside"]}.
Wednesday, September 25, 13
RECORDS - ELIXIR
defmodule Records do
defrecord Robots, name: nil,
type: industrial,
hobbies: nil,
details: ["Moved by a small man inside"]
def first_robot do
Robot.new(name: "Mechatron",
type: :handmade,
details: ["Moved by a small man inside"])
end
end
Wednesday, September 25, 13
POLYMORPHISM -
ELIXIR
defprotocol Blank do
@doc "Returns true if data is considered blank/empty"
def blank?(data)
end
# Numbers are never blank
defimpl Blank, for: Number do
def blank?(_), do: false
end
# Just empty list is blank
defimpl Blank, for: List do
def blank?([]), do: true
def blank?(_), do: false
end
# Just the atoms false and nil are blank
defimpl Blank, for: Atom do
def blank?(false), do: true
def blank?(nil), do: true
def blank?(_), do: false
end
Wednesday, September 25, 13
METAPROGRAMMING -
ELIXIR
defmodule MyMacro do
defmacro unless(clause, options) do
quote do: if(!unquote(clause), unquote(options))
end
end
require MyMacro
unless 2 + 2 == 5, do: call_function()
Wednesday, September 25, 13
DOWNSIDES - ERLANG
No Metaprogramming
No Polymorphism (mostly)
Obscure Syntax
Records are horrible
Wednesday, September 25, 13
DOWNSIDES - ELIXIR
Its young, so changes a fair amount
Truthiness is the devil
Macros are not sufficiently flexible (as what I am used to in
lisp)
Awkward syntax
Fair amount of inconsistency
Not really accepted by Erlangers
Wednesday, September 25, 13
UPSIDES - ERLANG
Simple, Regular Syntax
Stable - Infrequent Changes
Robust and Extraordinarily well tested
Wednesday, September 25, 13
UPSIDES - ELIXIR
Metaprogramming, Metaprogramming, Metaprogramming
Polymorphism
Non stable (ie, improving) syntax
Robust, usable shell
Did I say metaprogramming
Wednesday, September 25, 13
WRAPPING UP
Rate This Talk - http://speakerrate.com/talks/26081-an-
introduction-to-erlang-elixir-eric-merritt
Contact me - @ericbmerritt, ericbmerritt@gmail.com,
Wednesday, September 25, 13

Mais conteúdo relacionado

Destaque

Enfermedades RARAS
Enfermedades RARASEnfermedades RARAS
Enfermedades RARASadrimar2450
 
Functional Programming With Elixir
Functional Programming With ElixirFunctional Programming With Elixir
Functional Programming With ElixirFramgia Vietnam
 
Introducción a las Enfermedades Raras - 27.03.2015
Introducción a las Enfermedades Raras - 27.03.2015Introducción a las Enfermedades Raras - 27.03.2015
Introducción a las Enfermedades Raras - 27.03.2015ilsintelligence
 
¿Qué son las Enfermedades Raras?
¿Qué son las Enfermedades Raras?¿Qué son las Enfermedades Raras?
¿Qué son las Enfermedades Raras?Ruben Lijo
 
Medicamentos huérfanos
Medicamentos huérfanosMedicamentos huérfanos
Medicamentos huérfanosMar Sánchez
 
Enfermedades raras
Enfermedades rarasEnfermedades raras
Enfermedades rarasUTCH
 
L A E P I D E M I O L O G I A C L A S E S
L A  E P I D E M I O L O G I A  C L A S E SL A  E P I D E M I O L O G I A  C L A S E S
L A E P I D E M I O L O G I A C L A S E Snayshia
 
secuenciación por el medoto de sanger
secuenciación por el medoto de sangersecuenciación por el medoto de sanger
secuenciación por el medoto de sangerwlarakc
 
Secuenciación del ADN - Lectura del adn de los organismos
Secuenciación del ADN - Lectura del adn de los organismosSecuenciación del ADN - Lectura del adn de los organismos
Secuenciación del ADN - Lectura del adn de los organismosEnzo Olivera Laureano
 

Destaque (20)

Enfermedades RARAS
Enfermedades RARASEnfermedades RARAS
Enfermedades RARAS
 
Functional Programming With Elixir
Functional Programming With ElixirFunctional Programming With Elixir
Functional Programming With Elixir
 
Elixir
ElixirElixir
Elixir
 
Las Enfermedades Raras
Las Enfermedades Raras Las Enfermedades Raras
Las Enfermedades Raras
 
Introducción a las Enfermedades Raras - 27.03.2015
Introducción a las Enfermedades Raras - 27.03.2015Introducción a las Enfermedades Raras - 27.03.2015
Introducción a las Enfermedades Raras - 27.03.2015
 
Enfermedades raras II
Enfermedades raras IIEnfermedades raras II
Enfermedades raras II
 
Elixir
ElixirElixir
Elixir
 
La Estrategia en Enfermedades Raras del SNS
La Estrategia en Enfermedades Raras del SNSLa Estrategia en Enfermedades Raras del SNS
La Estrategia en Enfermedades Raras del SNS
 
¿Qué son las Enfermedades Raras?
¿Qué son las Enfermedades Raras?¿Qué son las Enfermedades Raras?
¿Qué son las Enfermedades Raras?
 
Enfermedades Raras y Crónicas
Enfermedades Raras y CrónicasEnfermedades Raras y Crónicas
Enfermedades Raras y Crónicas
 
Medición en salud
Medición en saludMedición en salud
Medición en salud
 
Validacion de escalas de medicion en salud
Validacion de escalas de medicion en saludValidacion de escalas de medicion en salud
Validacion de escalas de medicion en salud
 
Enfermedades raras i
Enfermedades raras iEnfermedades raras i
Enfermedades raras i
 
Medicamentos huérfanos
Medicamentos huérfanosMedicamentos huérfanos
Medicamentos huérfanos
 
Enfermedades raras
Enfermedades rarasEnfermedades raras
Enfermedades raras
 
Enfermedades raras
Enfermedades rarasEnfermedades raras
Enfermedades raras
 
L A E P I D E M I O L O G I A C L A S E S
L A  E P I D E M I O L O G I A  C L A S E SL A  E P I D E M I O L O G I A  C L A S E S
L A E P I D E M I O L O G I A C L A S E S
 
mortalidad materna brasil introduccion_lozano_120210_ihme
mortalidad materna brasil introduccion_lozano_120210_ihmemortalidad materna brasil introduccion_lozano_120210_ihme
mortalidad materna brasil introduccion_lozano_120210_ihme
 
secuenciación por el medoto de sanger
secuenciación por el medoto de sangersecuenciación por el medoto de sanger
secuenciación por el medoto de sanger
 
Secuenciación del ADN - Lectura del adn de los organismos
Secuenciación del ADN - Lectura del adn de los organismosSecuenciación del ADN - Lectura del adn de los organismos
Secuenciación del ADN - Lectura del adn de los organismos
 

Último

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 

Último (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

An introduction to Erlang and Elixir

  • 1. AN INTRODUCTION TO ERLANG AND ELIXIR Wednesday, September 25, 13
  • 2. WHAT IS ERLANG Modular, Declarative Language who’s syntax descends from prolog Wednesday, September 25, 13
  • 3. WHAT IS ELIXIR Modular, Declarative language with meta programming facilities whose syntax descends (mostly) from Ruby Wednesday, September 25, 13
  • 4. ERLANG VM - WHY SO INTERESTING Built Around Concurrency Built in scheduler Async IO Concurrent Garbage collector Wednesday, September 25, 13
  • 5. ERLANG VM - WHY SO INTERESTING Small Number of Serializable Types Pattern Matching Processes Process Linking Immutable Data Wednesday, September 25, 13
  • 6. ERLANG VM Erlang Elixir Joxa LFE The Concurrent Schemer Reia Wednesday, September 25, 13
  • 7. ERLANG VM - TYPES Numbers Atoms Bit Strings and Binaries Fun Tuple List Wednesday, September 25, 13
  • 9. RECORDS - ERLANG -module(records). -record(robot, {name, type=industrial, hobbies, details=[]}). first_robot() -> #robot{name="Mechatron", type=handmade, details=["Moved by a small man inside"]}. Wednesday, September 25, 13
  • 10. RECORDS - ELIXIR defmodule Records do defrecord Robots, name: nil, type: industrial, hobbies: nil, details: ["Moved by a small man inside"] def first_robot do Robot.new(name: "Mechatron", type: :handmade, details: ["Moved by a small man inside"]) end end Wednesday, September 25, 13
  • 11. POLYMORPHISM - ELIXIR defprotocol Blank do @doc "Returns true if data is considered blank/empty" def blank?(data) end # Numbers are never blank defimpl Blank, for: Number do def blank?(_), do: false end # Just empty list is blank defimpl Blank, for: List do def blank?([]), do: true def blank?(_), do: false end # Just the atoms false and nil are blank defimpl Blank, for: Atom do def blank?(false), do: true def blank?(nil), do: true def blank?(_), do: false end Wednesday, September 25, 13
  • 12. METAPROGRAMMING - ELIXIR defmodule MyMacro do defmacro unless(clause, options) do quote do: if(!unquote(clause), unquote(options)) end end require MyMacro unless 2 + 2 == 5, do: call_function() Wednesday, September 25, 13
  • 13. DOWNSIDES - ERLANG No Metaprogramming No Polymorphism (mostly) Obscure Syntax Records are horrible Wednesday, September 25, 13
  • 14. DOWNSIDES - ELIXIR Its young, so changes a fair amount Truthiness is the devil Macros are not sufficiently flexible (as what I am used to in lisp) Awkward syntax Fair amount of inconsistency Not really accepted by Erlangers Wednesday, September 25, 13
  • 15. UPSIDES - ERLANG Simple, Regular Syntax Stable - Infrequent Changes Robust and Extraordinarily well tested Wednesday, September 25, 13
  • 16. UPSIDES - ELIXIR Metaprogramming, Metaprogramming, Metaprogramming Polymorphism Non stable (ie, improving) syntax Robust, usable shell Did I say metaprogramming Wednesday, September 25, 13
  • 17. WRAPPING UP Rate This Talk - http://speakerrate.com/talks/26081-an- introduction-to-erlang-elixir-eric-merritt Contact me - @ericbmerritt, ericbmerritt@gmail.com, Wednesday, September 25, 13