Introdução à Elixir
Contexto, ecossistema e aplicações
Sobre a linguagem
● Criada em 2012 pelo José Valim ->
● Funcional
● Concorrente
● Compilada
● Interoperabilidade com Erlang
● Metaprogramação
● Polimorfismo
Introdução à Elixir
Quem está usando
● Discord
● Brex
● ThoughtWorks
● Globo.com
● Slack
● B2W Digital
● Adobe
● Pinterest
● etc
Elixir é bom para
● Web API/Apps
● Soft real-time (Chat Bot, Google Docs, IoT…)
● High scalability and fault tolerance
● Concurrency
● Developer happiness
Elixir não é bom para
● Number crunching *
● Any CPU bound *
● ...
O paradigma funcional λ
● Funções puras
● Imutabilidade (Variáveis, estrutura de dados)
● Composição
● Recursão
● Transparência referencial
● First class and high order functions
● Type system
● Modularidade
Erlang / OTP
● Usada em 50% dos switches de telecom
● Erlang Virtual Machine (Beam)
● Escalabilidade
● Alta disponibilidade
● Modelo de atores
Erlang / OTP
● 1986: Linguagem proprietária (Ericsson)
● 1995: OTP ("Open Telecom Platform")
● 1998: Erlang / OTP Open Sourced
● ...
● 2008: Facebook Chat
● 2010: Whatsapp
● Outros: RabbitMQ, CouchDB, Riak, Amazon SimpleDB
THE ERLANG
VM: BEAM
Preemptive scheduling
The Beam and Parallel Processing
Concurrent / Parallel
Context
Switch
Actor model
https://www.youtube.com/watch?v=ELw
Edb_pD0k
https://www.brianstorti.com/the-actor-
model/
http://dist-prog-book.com/chapter/3/
message-passing.html
Useful links:
Actor model
Actors are defined as independent units of computation with isolated state.
These units have two core characteristics:
● They can send messages asynchronously* to one another
● They have a mailbox which contains messages that they have received,
allowing messages to be received at any time and then queued for
processing.
What Can Actors Do
● Create new actors
● Receive messages and in response:
○ make local decisions (alter local state)
○ perform arbitrary, side-effecting action
○ send messages
○ respond to sender 0 or more times
● “Do not communicate by sharing memory; instead share memory by
communicating” - Effective Go
Actor model
● Actors process messages one at a time
● State is shared only through messages
● Actors do not share memory
● It doesn’t matter if the actor that I’m sending a message to is running
locally or in another node
● Actors knows other actors by identify
● Great project: https://akka.io/ (Java / Scala / JVM 😎)
Why use actors?
● Protect state
● No need for locks and synchronization
● Concurrency
● etc
Process-based actors (Erlang)
1. Everything is a process
2. Processes are strongly isolated
3. Process creation and destruction is a lightweight operation
4. Message passing is the only way for processes to interact
5. Processes have unique names
6. If you know the name of a process you can send it a message
7. Processes share no resources
8. Error handling is non-local
9. Processes do what they are supposed to do or fail
http://erlang.org/download/armstrong_thesis_2003.pdf
Supervision Tree
Policies
Umbrella project
Scale to distributed system
E A ELIXIR?
Basic Types
Tuples, Lists, Maps
Control Structures
Control Structures
Control Structures
Control Structures
Functions
Functions
Functions
Guards
Anonymous Functions
Structs
Protocols
Some
similarities
to an OOP
Interface
Pattern Matching
Pattern Matching (destructuring)
Pattern Matching Structs
Even More Pattern Matching
Pipe Operator |>
Simple Interop with Erlang
Can easily leverage 20+ years of Erlang libraries
Lodash.js?
https://hexdocs.pm/elixir/Enum.html
Loop?
Other stuff
● Modules
● Mix (tasks)
● ExUnit (tests)
● Macros
● Error Handling
● OTP Concurrency
● OTP Supervisors
● etc
Ecosystem
HEX
Ecto Absinthe https://github.com/h4cc/awesome-elixir
GUARDIAN
Handling a HTTP request
Handling a HTTP request
Handling a HTTP request
The Elixir way
The Elixir way
Muito
obrigado!

More Related Content

PDF
Configuración de mikro tik para thundercache
DOC
VHDL coding in Xilinx
PDF
Sách cờ tướng dạy các thế cờ tàn thực dụng
PDF
University of alabama in Huntsville affidavit of fin support
PPTX
CCNA Product Overview.pptx
PDF
Bidirectional Forwarding Detection (BFD)
DOCX
How to connect to cisco asa
PDF
The Mini-Manual for the Urban Defender
Configuración de mikro tik para thundercache
VHDL coding in Xilinx
Sách cờ tướng dạy các thế cờ tàn thực dụng
University of alabama in Huntsville affidavit of fin support
CCNA Product Overview.pptx
Bidirectional Forwarding Detection (BFD)
How to connect to cisco asa
The Mini-Manual for the Urban Defender

Similar to Introdução à Elixir (20)

PPTX
A sip of elixir
PPTX
Introduction to f#
PDF
Erlang: Software for a Concurrent world
PDF
Reactive Software Systems
PDF
Introduction to concurrent programming with akka actors
PDF
Introduction to concurrent programming with Akka actors
PPTX
The Professional Programmer
PDF
The working architecture of NodeJs applications
PDF
Unit 1 Core Java for Compter Science 3rd
ODP
Elixir otp-basics
PDF
DDD with Behat
PDF
erlang 101
PPT
JAVA object oriented programming (oop).ppt
PDF
Multithreading in Scala
ODP
Elm & Elixir: Functional Programming and Web
PPTX
Introucing Erlang
PDF
The working architecture of NodeJS applications, Виктор Турский
PDF
The working architecture of node js applications open tech week javascript ...
PDF
Implementing GraphQL API in Elixir – Victor Deryagin
PDF
Full stack development
A sip of elixir
Introduction to f#
Erlang: Software for a Concurrent world
Reactive Software Systems
Introduction to concurrent programming with akka actors
Introduction to concurrent programming with Akka actors
The Professional Programmer
The working architecture of NodeJs applications
Unit 1 Core Java for Compter Science 3rd
Elixir otp-basics
DDD with Behat
erlang 101
JAVA object oriented programming (oop).ppt
Multithreading in Scala
Elm & Elixir: Functional Programming and Web
Introucing Erlang
The working architecture of NodeJS applications, Виктор Турский
The working architecture of node js applications open tech week javascript ...
Implementing GraphQL API in Elixir – Victor Deryagin
Full stack development
Ad

Recently uploaded (20)

PPTX
Lecture 5 Software Requirement Engineering
PPTX
Plex Media Server 1.28.2.6151 With Crac5 2022 Free .
PDF
CCleaner 6.39.11548 Crack 2025 License Key
PDF
Understanding the Need for Systemic Change in Open Source Through Intersectio...
PPTX
string python Python Strings: Literals, Slicing, Methods, Formatting, and Pra...
PDF
Workplace Software and Skills - OpenStax
PDF
Practical Indispensable Project Management Tips for Delivering Successful Exp...
PPTX
Chapter 1 - Transaction Processing and Mgt.pptx
PDF
BoxLang Dynamic AWS Lambda - Japan Edition
PDF
CapCut PRO for PC Crack New Download (Fully Activated 2025)
PPTX
4Seller: The All-in-One Multi-Channel E-Commerce Management Platform for Glob...
DOC
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
PDF
Microsoft Office 365 Crack Download Free
PDF
E-Commerce Website Development Companyin india
PPTX
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
PPTX
Presentation by Samna Perveen And Subhan Afzal.pptx
PPT
3.Software Design for software engineering
PDF
PDF-XChange Editor Plus 10.7.0.398.0 Crack Free Download Latest 2025
PPTX
Matchmaking for JVMs: How to Pick the Perfect GC Partner
PDF
Sun and Bloombase Spitfire StoreSafe End-to-end Storage Security Solution
Lecture 5 Software Requirement Engineering
Plex Media Server 1.28.2.6151 With Crac5 2022 Free .
CCleaner 6.39.11548 Crack 2025 License Key
Understanding the Need for Systemic Change in Open Source Through Intersectio...
string python Python Strings: Literals, Slicing, Methods, Formatting, and Pra...
Workplace Software and Skills - OpenStax
Practical Indispensable Project Management Tips for Delivering Successful Exp...
Chapter 1 - Transaction Processing and Mgt.pptx
BoxLang Dynamic AWS Lambda - Japan Edition
CapCut PRO for PC Crack New Download (Fully Activated 2025)
4Seller: The All-in-One Multi-Channel E-Commerce Management Platform for Glob...
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
Microsoft Office 365 Crack Download Free
E-Commerce Website Development Companyin india
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
Presentation by Samna Perveen And Subhan Afzal.pptx
3.Software Design for software engineering
PDF-XChange Editor Plus 10.7.0.398.0 Crack Free Download Latest 2025
Matchmaking for JVMs: How to Pick the Perfect GC Partner
Sun and Bloombase Spitfire StoreSafe End-to-end Storage Security Solution
Ad

Introdução à Elixir