SlideShare a Scribd company logo
Bootstrap
EASY FUN FOR BUSY DEVELOPERS
|> Elixir
YET
ANOTHER
PROGRAMMING
LANGUANGE?
Y
A
P
L
DON’T RUN AWAY
Elixir is special!
Elixir in a Nutshell
= +
Elixir in a Nutshell
+
PROGRAMMERS OFTEN FEEL JOY WHEN THEY CAN CONCENTRATE ON THE
CREATIVE SIDE OF PROGRAMMING, SO RUBY IS DESIGNED TO
MAKE PROGRAMMERS HAPPY. I CONSIDER A PROGRAMMING
LANGUAGE AS A USER INTERFACE, SO IT SHOULD FOLLOW THE
PRINCIPLES OF USER INTERFACE.
Yukihiro Matsumoto, Ruby Inventor
Why Ruby is awesome
Principle of Conciseness
Principle of Consistency
Principle of Flexibility
Why Ruby is awesome
THE AXD301 HAS ACHIEVED A NINE NINES RELIABILITY (YES, YOU
READ THAT RIGHT, 99.9999999%). LET’S PUT THIS IN
CONTEXT: 5 NINES IS RECKONED TO BE GOOD (5.2 MINUTES OF
DOWNTIME/YEAR). 7 NINES ALMOST UNACHIEVABLE ... BUT WE
DID 9.
Joe Armstrong, Erlang Designer
Why Erlang is awesome
Battle-proven BEAM and OTP
Ever seen WhatsApp crash?
Reactive before Reactive-is-HipTm
Actors before Actors-are—HipTm
Why Erlang is awesome
Why Clojure is awesome
Because Rich Hickey is always right
SO…WHY NOT DO RUBY, ERLANG OR CLOJURE?
WHY NOT USE RUBY?
SPEED, CONCURRENCY, SCALABILITY
WHY NOT USE ERLANG?
SYNTAX, BAROQUE TOOLING
WHY NOT USE CLOJURE?
…NO REASON, REALLY. GO AHEAD USE IT!
Scalability, lightweight Threads
Fault-tolerance, Supervisor
Functional, immutable
DSLs using Meta-Programming
Mix, Hex, ExUnit,…
REPL for easy learning
Why Elixir is awesome
Scalability, lightweight Threads
Fault-tolerance, Supervisor
Functional, immutable
DSLs using Meta-Programming
Mix, Hex, ExUnit,…
REPL for easy learning
Why Elixir is awesome
100000 Processes
1..100_000
|> Enum.map(&(Task.async(
fn -> &1 * &1 end
)))
|> Enum.map(&Task.await/1)
[1, 4, 9, 16, 25, 36, 49, 64, 81, 100,
121, 144, 169, 196, 225, 256, 289, 324,
361, 400, 441, 484, 529, 576, 625, 676,
729, 784, 841, 900, 961, 1024, 1089,
1156, 1225, 1296, 1369, 1444, 1521,
1600, 1681, 1764, 1849, 1936, 2025, 2116,
2209, 2304, 2401, 2500, ...]
100000 Processes
1..100_000
|> Enum.map(&(Task.async(
fn -> &1 * &1 end
)))
|> Enum.map(&Task.await/1)
?what?
100000 Processes
Quick
syntax
bootcamp
Creating a project
$ mix new demo
$ cd demo
$ mix test
Read Eval Print Loop
$ iex -S mix
Erlang/OTP 18 …
Interactive Elixir (1.2.4) - press Ctrl+C to
exit (type h() ENTER for help)
iex(1)> IO.puts “Hello Elixir”
Hello Elixir
:ok
Transform - don’t mutate
10
|> fib
|> IO.puts
IO.puts(fib(10))
transformation pipeline
Declaring functions
def fib(0), do: 0
def fib(0) do
0
end
(n-1) + fib(n-2)
end
same thing
Pattern matching
def fib(0), do: 0
def fib(1), do: 1
def fib(n) when n > 1
iex> fib(1)
pattern matching
Guard expressions
def fib(n) when n > 1 do
fib(n-1) + fib(n-2)
end
guard expression
iex> fib(-3)
** (FunctionClauseError)
no function clause
matching in fib/1
(fibnew) lib/fib2.ex:2: fib(-3)
Things go wrong
Anonymous functions
fn n ->
n + 2
end
&( &1 + 2 )
same thing
Function shortcuts
IO.puts/2
def puts(device, item)
/2 denotes the number of args
Compile-time structural decomposition
def sqrt([h | t]), do: …
iex> sqrt([1, 2, 3, 4 ])
Show me the code
Demo
ELIXIR APPLICATION DESIGN
APPLICATIONS, SUPERVISORS, PROCESSES
Shared resources Shared state Shared stability
PROCESS
SHARED STATE
Shared nothing Message passing
PROCESS
PROCESS
PROCESS
PROCESS
PROCESS
PROCESS
PROCESS
PROCESS
PROCESS
PROCESS
PROCESS
PROCESS
PROCESS
Abstractions for Resilience
Agent…abstractions around state
GenServer…long-running, messaging
Supervisor…let it crash
Application…just think component
Abstractions for Resilience
Agent…abstractions around state
GenServer…long-running, messaging
Supervisor…let it crash
Application…just think component
Message-based design using GenServer
BA
GenServer.start_link
{:ok, #PID<0.112.0>}
Message-based design using GenServer
BA
GenServer.call(B, {:sum, 1..3})
Message-based design using GenServer
BA
handle_call({:sum, 1..3}, from, state)
Message-based design using GenServer
BA
{:reply, {:ok, 6}, new_state)
GenServer
Demo
Bootstrap |> Elixir - Easy fun for busy developers
Move risk to the bottom of the supervision tree
APPLICATION
SUPERVISOR WORKER C
WORKER A WORKER B Here be dragons…
FILE IO DB ACCESS
Supervisors watch their children
APPLICATION
SUPERVISOR WORKER C
WORKER A WORKER B
:one_for_one!
:one_for_one replaces failed process
APPLICATION
SUPERVISOR WORKER C
WORKER A WORKER B WORKER B’ Auto-restart
Supervisor
Demo
Processes are distributed across nodes
PROCESS
PROCESS
PROCESS
PROCESS
PROCESS
PROCESS
PROCESS
PROCESS
PROCESS
PROCESS
PROCESS
PROCESS
PROCESS
:”one@foo”
:”two@foo”
Nodes and distribution
Demo
MORE COOL FEATURES
TEASERS ONLY
Testing documentation
@doc """
iex> sieve(10)
[2, 3, 5, 7]
"""
def sieve(n) do
...
end
defmodule Test do
use ExUnit.Case
doctest
…
end
Hygienic Macros
defmacro time([do: body]) do
quote do
s = :os.system_time(…)
unquote(body)
f = :os.system_time(…)
info(“Took #{s-f} ms")
end
end
time do
IO.puts "Something"
:timer.sleep(100)
end
[info] Took 101 ms
There is so much more
Protocols
Sigils
Umbrella projects
Ecto
Phoenix
Hot code replacement
SHOULD WE ALL START
BUILDING EVERYTHING
WITH ELIXIR?
Bootstrap |> Elixir - Easy fun for busy developers
WELL….MAYBE NOT?!
New insights and ideas
Clean patterns
Architecture for IoT
Vibrant Community
学⼀一⻔门语⾔言,就是多⼀一个观察世界的窗户。
To learn a language is to have one more window from which to look at the world
Elixir Homepage, http://elixir-lang.org/
Dave Thomas, Programming Elixir
Fred Hebert, Stuff Goes Bad: Erlang in Anger
José Valim, Introduction to Elixir https://
youtu.be/41PvAPSX0wg
Slides + Code, https://git.io/vKUGc
Do you want to know more?
Thank you very much!
<david.schmitz@senacor.com> @koenighotze

More Related Content

PDF
Elixir and OTP
PDF
Hello elixir (and otp)
PDF
Concurrency in Elixir with OTP
PDF
Introducing Elixir and OTP at the Erlang BASH
PDF
Introduction to Elixir
PDF
Elixir Into Production
PDF
ElixirConf Lightning Talk: Elixir |> Production
PDF
Elixir and Phoenix for Rubyists
Elixir and OTP
Hello elixir (and otp)
Concurrency in Elixir with OTP
Introducing Elixir and OTP at the Erlang BASH
Introduction to Elixir
Elixir Into Production
ElixirConf Lightning Talk: Elixir |> Production
Elixir and Phoenix for Rubyists

What's hot (20)

PDF
Phoenix for Rails Devs
PDF
Actor Clustering with Docker Containers and Akka.Net in F#
PDF
Atmosphere 2014
PDF
Concurrecny inf sharp
PDF
Yaroslav Martsynyuk - Deploying Elixir/Phoenix with Distillery
PPTX
Elixir introduction
PDF
第1回PHP拡張勉強会
PDF
effective_r27
PDF
Tame cloud complexity with F# powered DSLs (build stuff)
PDF
Mobile Open Day: React Native: Crossplatform fast dive
PDF
Ansible Callback Plugins
PDF
React Native One Day
PDF
Wrapping java in awesomeness aka condensator
PDF
KKBOX WWDC17 Xcode debug - Oliver
PPTX
10 tips for making Bash a sane programming language
PDF
Introduction to Erlang/(Elixir) at a Webilea Hands-On Session
PDF
Découvrir dtrace en ligne de commande.
PDF
Hug presentation for android tech talks #14
PPTX
Nevermore Unit Testing
PDF
Akka Futures and Akka Remoting
Phoenix for Rails Devs
Actor Clustering with Docker Containers and Akka.Net in F#
Atmosphere 2014
Concurrecny inf sharp
Yaroslav Martsynyuk - Deploying Elixir/Phoenix with Distillery
Elixir introduction
第1回PHP拡張勉強会
effective_r27
Tame cloud complexity with F# powered DSLs (build stuff)
Mobile Open Day: React Native: Crossplatform fast dive
Ansible Callback Plugins
React Native One Day
Wrapping java in awesomeness aka condensator
KKBOX WWDC17 Xcode debug - Oliver
10 tips for making Bash a sane programming language
Introduction to Erlang/(Elixir) at a Webilea Hands-On Session
Découvrir dtrace en ligne de commande.
Hug presentation for android tech talks #14
Nevermore Unit Testing
Akka Futures and Akka Remoting
Ad

Viewers also liked (10)

PDF
Elixir - Easy fun for busy developers @ Devoxx 2016
PDF
Javaslang @ Devoxx
PDF
Spring boot - Getting Started
PPTX
Elixir Phoenix
PDF
Docker for the Brave
PDF
Current and future plans for ELIXIR presentation given by Niklas Blomberg, EL...
PDF
IET NW Region - Payment Hub Design
PDF
Real Life Clean Architecture
PDF
Javaslang Talk @ Javaland 2017
PDF
10 Tips for failing at microservices
Elixir - Easy fun for busy developers @ Devoxx 2016
Javaslang @ Devoxx
Spring boot - Getting Started
Elixir Phoenix
Docker for the Brave
Current and future plans for ELIXIR presentation given by Niklas Blomberg, EL...
IET NW Region - Payment Hub Design
Real Life Clean Architecture
Javaslang Talk @ Javaland 2017
10 Tips for failing at microservices
Ad

Similar to Bootstrap |> Elixir - Easy fun for busy developers (20)

PDF
Osdc09 Apr09 openQRM Workshop
PDF
Two Years, Zero servers: Lessons learned from running a startup 100% on Serve...
PDF
From Elixir to Akka (and back) - ElixirConf Mx 2017
PDF
Re-Design with Elixir/OTP
PDF
How do I run microservices in production using Docker.
PDF
TIAD - DYI: A simple orchestrator built step by step
ODP
Plug yourself in and your app will never be the same (1 hr edition)
PDF
Angular - Improve Runtime performance 2019
PDF
[1D6]RE-view of Android L developer PRE-view
PDF
Yurii Bodarev - OTP, Phoenix & Ecto: Three Pillars of Elixir
PDF
Dutch PHP Conference 2013: Distilled
PDF
Concurrency, Robustness & Elixir SoCraTes 2015
PDF
不深不淺,帶你認識 LLVM (Found LLVM in your life)
PDF
The Joy Of Ruby
PDF
Erlang in 10 minutes
PDF
MapReduce: teoria e prática
PDF
Zope component architechture
PDF
Adhearsion and Telegraph Framework Presentation
PDF
React Native in Production
PDF
Is writing performant code too expensive?
Osdc09 Apr09 openQRM Workshop
Two Years, Zero servers: Lessons learned from running a startup 100% on Serve...
From Elixir to Akka (and back) - ElixirConf Mx 2017
Re-Design with Elixir/OTP
How do I run microservices in production using Docker.
TIAD - DYI: A simple orchestrator built step by step
Plug yourself in and your app will never be the same (1 hr edition)
Angular - Improve Runtime performance 2019
[1D6]RE-view of Android L developer PRE-view
Yurii Bodarev - OTP, Phoenix & Ecto: Three Pillars of Elixir
Dutch PHP Conference 2013: Distilled
Concurrency, Robustness & Elixir SoCraTes 2015
不深不淺,帶你認識 LLVM (Found LLVM in your life)
The Joy Of Ruby
Erlang in 10 minutes
MapReduce: teoria e prática
Zope component architechture
Adhearsion and Telegraph Framework Presentation
React Native in Production
Is writing performant code too expensive?

More from David Schmitz (11)

PDF
Going Cloud Native
PDF
Eventsourcing you-are-doing-it-wrong-vxdparis
PDF
Vavr Java User Group Rheinland
PDF
Event Sourcing - You are doing it wrong @ Devoxx
PDF
10 Tipps für ein absolutes Microservice-Desaster
PDF
10 tips for failing at microservices @ DevExperience 2018
PDF
Real world serverless - architecture, patterns and lessons learned
PDF
The FaaS and the Furious
PDF
10 Tips for failing at microservices - badly (BedCon 2017)
PDF
Javaslang - Functional Sugar For Java
PDF
Resilience testing with Wiremock and Spock
Going Cloud Native
Eventsourcing you-are-doing-it-wrong-vxdparis
Vavr Java User Group Rheinland
Event Sourcing - You are doing it wrong @ Devoxx
10 Tipps für ein absolutes Microservice-Desaster
10 tips for failing at microservices @ DevExperience 2018
Real world serverless - architecture, patterns and lessons learned
The FaaS and the Furious
10 Tips for failing at microservices - badly (BedCon 2017)
Javaslang - Functional Sugar For Java
Resilience testing with Wiremock and Spock

Recently uploaded (20)

PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Empathic Computing: Creating Shared Understanding
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Big Data Technologies - Introduction.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Cloud computing and distributed systems.
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Chapter 3 Spatial Domain Image Processing.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Empathic Computing: Creating Shared Understanding
sap open course for s4hana steps from ECC to s4
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Understanding_Digital_Forensics_Presentation.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Big Data Technologies - Introduction.pptx
Network Security Unit 5.pdf for BCA BBA.
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
NewMind AI Weekly Chronicles - August'25 Week I
Cloud computing and distributed systems.
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
The AUB Centre for AI in Media Proposal.docx
Unlocking AI with Model Context Protocol (MCP)
Chapter 3 Spatial Domain Image Processing.pdf

Bootstrap |> Elixir - Easy fun for busy developers