SlideShare a Scribd company logo
New software
for new hardware
Elixir meetup 4.0, Lviv, December 17, 2016
Elixir introduction
Hello!
I am Anton Mishchuk
- Ruby developer at
Matic Insurance
- Elixir fan
- Author and maintainer of
ESpec BDD test framework
Github: antonmi
2
What I’d tell you
▪ No pictures, sorry
▪ No code samples
▪ No live coding
▪ Lots of philosophy
▪ Few words about Erlang and Elixir
3
The plan
▪ Software crisis?
▪ Resurrection of FP
▪ Erlang
▪ Erlang concurrency model
▪ Elixir
▪ Elixir is not Ruby
▪ You should try Elixir
4
1
Software crisis?
5
Common characteristic of
present software
▪ low quality
▪ very inefficient
▪ difficult to maintain
6
Nathan Myhrvold’s laws
▪ “Software is a gas”
▪ “Software grows until it becomes
limited by Moore’s Law”
▪ “Software growth makes Moore’s
Law possible”
▪ “Software is only limited by
human ambition and expectation”
7
Nathan Myhrvold, formerly CTO at Microsoft
Niklaus Wirth’s Law:
“Software gets slower
faster than hardware
gets faster”
8
Niklaus Wirth, computer scientist,
designer of several PL (incl. Pascal)
What next?
9
▪ Better hardware?
or
▪ Better software?
10
We are experiencing a period
of “dramatic changes”
▪ New hardware!
▪ New software!
11
New hardware:
▪ Multicore systems
▪ ASIC (Application-specific
integrated circuit)
▪ FPGA (Field-programmable gate
array)
12
“The von Neumann Syndrome”
New software:
Multicore crisis:
To take advantage of the additional
cores most applications have to be
rewritten
13
2
Resurrection of FP
14
Functional programming
FP is a programming paradigm
that treats computation as the
evaluation of mathematical
functions.
FP: Data structures manipulated
through functions
OOP: Objects manipulated through
methods
15
FP concepts
▪ High-order functions
▪ Pure functions
▪ Recursions
▪ Lazy evaluations
▪ Currying
▪ Closures
16
History
FP:
▪ Lisp, 1950s
▪ APL, 1960s
▪ Haskell, late 80s
▪ Erlang, 1986
OOP:
▪ Simula, 1960s
▪ Smalltalk, 1970s
▪ Java, Ruby, 1995
17
CPU:
▪ Single-processor machines
▪ 50%/year clock speed growth
▪ From ~10MHz to ~1GHz
RAM:
▪ Relatively expensive and slow
▪ $100/1Mb in 1990. $1/1Mb in 2000
▪ CPU cache
OOP dominating in 90s
18
▪ Is OOP the only right way to to
create software?
▪ Is OOP the RIGHT way?
19
Why OO sucks?
(c) Joe Armstrong
20
▪ Functions do things
▪ Data structures just are
Since functions and data structures
are completely different types of
animal it is fundamentally
incorrect to lock them up in the
same cage.
Objection 1:
Data structure and functions
should not be bound together
21
▪ Should “time” to be an instance
of some type?
▪ Should a simple integer number to
be an instance of some type?
Objection 2:
Everything has to be an object
22
▪ lots of types with limited amount
of specific functions
Isn't it better have a smallish
number of ubiquitous data types and
a large number of small functions
that work on them?
Objection 3:
Data type definitions are
spread out all over the place
23
The state is hidden and visible
only through access functions.
State is the root of all evil!
Objection 4:
Objects have private state
24
Why OO was popular?
(c) Joe Armstrong
25
▪ It was thought to be easy to
learn.
▪ It was thought to make code reuse
easier.
▪ It was hyped.
▪ It created a new software
industry.
Why OO was popular?
(c) Joe Armstrong
26
I see no evidence of 1 and 2.
Reasons 3 and 4 seem to be
the driving force behind the
technology.
27
If a language technology is so bad
that it creates a new industry to
solve problems of its own making then
it must be a good idea for the guys
who want to make money.
28
3
Erlang
29
▪ Elixir compiler is written in
Erlang
▪ Both Elixir and Erlang compiles
into BEAM byte code
Elixir == Erlang
30
▪ Ericsson, 1986
▪ Joe Armstrong, Robert Virding and
Mike Williams
▪ Open-sourced in 1998
▪ Telecom systems (telephone
switches)
▪ The latest version is 19.1
Erlang
31
▪ Fault tolerance
▪ Scalability
▪ Distribution
▪ Live update
Erlang buzzwords
32
▪ Ericsson
▪ WhatsApp
▪ Facebook
▪ Amazon
▪ Bet365
▪ Demonware
▪ ...
Companies using Erlang
33
▪ Modules
▪ Functions
▪ Primitive data types:
atoms, integers, floats, tuples,
lists, maps, strings, binaries,
records, references, pids, ports,
funs.
Erlang components
34
4
Erlang concurrency model
35
▪ Native threads
▪ Green threads
▪ Event loop
It is not about:
36
▪ lightweight processes
▪ with isolated memory
▪ communication via messages
It is about “actors”
37
In response to a message actor
receives, can concurrently:
▪ send a finite number of messages
to other actors
▪ create a finite number of new
actors
▪ Set the “state” to be used for
the next message it receives
Actors
38
▪ Controlled by BEAM VM
▪ ~ 1µs to create process
▪ ~ 1kB memory per process
▪ ~ 1µs to pass a message
Erlang actors
39
▪ encapsulate state
▪ communicate with other actors by
exchanging messages
More OO than objects
40
▪ Tools
▪ Libraries
Design principles:
▪ Workers and Supervisors
▪ GenServer, GenFSM
▪ Event Handler and Manager
▪ Application
Erlang OTP
41
5
Elixir
42
▪ Jose Valim, 2012
▪ Current version 1.3
▪ Hex.pm
▪ >3000 packages, ~20000 down/day
▪ Elixir Conf EU, Elixir Conf US
▪ Elixir Companies
▪ Phoenix web framework
(2M websocket conns)
Elixir
43
What is Elixir?
44
Elixir is Erlang with pretty syntax
and metaprogramming
▪ Consistent stdlib
▪ Pipe operator
▪ Tools (mix, iex, logger)
Elixir metaprogramming
45
▪ Easy code sharing
▪ Perfect Ruby-like DSLs
6
Elixir is not Ruby
46
Elixir is functional
47
▪ Function is a primary Elixir
abstraction.
▪ Data is immutable
▪ Minimal state manipulation
Ruby is OO language
with some FP features
48
▪ Procs, lambdas
▪ No FP optimizations
▪ Data is mutable
Concurrency model
49
In Ruby, one moves through a
monolithic call stack, manipulating
objects. Threads or fibers uses the
same memory heap.
Elixir processes have their own
heaps, and the VM collects process'
garbage independently of each
other.
What is the same?
50
“programmer happiness” philosophy:
▪ Pretty syntax
▪ Good documentation
▪ Tools for easy development
7
You should try Elixir
51
Think about future software
52
▪ Multi-core computers
▪ IoT with up to 30 billion devices
to be online by 2020
Double paradigm switch
53
▪ Functional programming
▪ Actor concurrency model
You’ll found it exciting
54
▪ It’s easy to get started
▪ Lots of tutorials
▪ Nice documentation
▪ Great community
Thanks!
ANY QUESTIONS?
55

More Related Content

PPTX
Repeating History...On Purpose...with Elixir
PDF
A sip of Elixir
PDF
Intro to elixir and phoenix
PPTX
What's the "right" PHP Framework?
ODP
EcoreTools-Next: Executable DSL made (more) accessible
PDF
Lock-free algorithms for Kotlin Coroutines
PPTX
The Actor Model - Towards Better Concurrency
PDF
Rethinking the debugger
Repeating History...On Purpose...with Elixir
A sip of Elixir
Intro to elixir and phoenix
What's the "right" PHP Framework?
EcoreTools-Next: Executable DSL made (more) accessible
Lock-free algorithms for Kotlin Coroutines
The Actor Model - Towards Better Concurrency
Rethinking the debugger

What's hot (19)

PPS
Erlang plus BDB: Disrupting the Conventional Web Wisdom
PPTX
Introduction to Elixir
PDF
Elixir – Peeking into Elixir's Processes, OTP and Supervisors
PPTX
Tofu and its environment
PDF
Anton Mishchuk - Multi-language FBP with Flowex
PDF
PHP7.1 New Features & Performance
PDF
Maccro Strikes Back
PDF
Invitation to the dark side of Ruby
KEY
Messaging, interoperability and log aggregation - a new framework
PDF
Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlan...
PDF
Eugene Letuchy Erlangat Facebook
PDF
Ruby is dying. What languages are cool now?
PPTX
Making Symfony Services async with RabbitMq (and more Symfony)
PDF
Multi-language FBP with flowex
PPTX
CPAN Curation
PDF
Concurrency, Robustness & Elixir SoCraTes 2015
KEY
Erlang - Dive Right In
PPTX
Coroutines in Kotlin
PDF
CBDW2014 - Down the RabbitMQ hole with ColdFusion
Erlang plus BDB: Disrupting the Conventional Web Wisdom
Introduction to Elixir
Elixir – Peeking into Elixir's Processes, OTP and Supervisors
Tofu and its environment
Anton Mishchuk - Multi-language FBP with Flowex
PHP7.1 New Features & Performance
Maccro Strikes Back
Invitation to the dark side of Ruby
Messaging, interoperability and log aggregation - a new framework
Erlang, LFE, Joxa and Elixir: Established and Emerging Languages in the Erlan...
Eugene Letuchy Erlangat Facebook
Ruby is dying. What languages are cool now?
Making Symfony Services async with RabbitMq (and more Symfony)
Multi-language FBP with flowex
CPAN Curation
Concurrency, Robustness & Elixir SoCraTes 2015
Erlang - Dive Right In
Coroutines in Kotlin
CBDW2014 - Down the RabbitMQ hole with ColdFusion
Ad

Viewers also liked (20)

PDF
Flow-based programming with Elixir
PDF
Hello elixir (and otp)
PDF
How Elixir helped us scale our Video User Profile Service for the Olympics
ODP
Elixir basics-2
PDF
Learn Elixir at Manchester Lambda Lounge
PPTX
A Brief Introduction To Erlang
PDF
Elixir - Easy fun for busy developers @ Devoxx 2016
PDF
Elixir and OTP
PDF
Brief Intro to Phoenix - Elixir Meetup at BukaLapak
PDF
Elixir & Phoenix 推坑
PDF
Build Your Own Real-Time Web Service with Elixir Phoenix
PDF
Introduction to Elixir
PDF
ITB2016 - Mixing up the front end with ColdBox elixir
PDF
How to become a chef
PDF
Massive concurrent modifications in web app. How to manage and test.
PDF
Asynchronous Ruby
PPTX
BioContainers on ELIXIR All Hands 2017
PDF
Espec - Elixir bdd
PDF
Intro to elixir metaprogramming
PDF
Clojure class
Flow-based programming with Elixir
Hello elixir (and otp)
How Elixir helped us scale our Video User Profile Service for the Olympics
Elixir basics-2
Learn Elixir at Manchester Lambda Lounge
A Brief Introduction To Erlang
Elixir - Easy fun for busy developers @ Devoxx 2016
Elixir and OTP
Brief Intro to Phoenix - Elixir Meetup at BukaLapak
Elixir & Phoenix 推坑
Build Your Own Real-Time Web Service with Elixir Phoenix
Introduction to Elixir
ITB2016 - Mixing up the front end with ColdBox elixir
How to become a chef
Massive concurrent modifications in web app. How to manage and test.
Asynchronous Ruby
BioContainers on ELIXIR All Hands 2017
Espec - Elixir bdd
Intro to elixir metaprogramming
Clojure class
Ad

Similar to Elixir intro (20)

PDF
Elixir for aspiring Erlang developers
PDF
Elixir Programming Language 101
PDF
The Ring programming language version 1.10 book - Part 6 of 212
PDF
Elixir and elm
PDF
The Ring programming language version 1.9 book - Part 6 of 210
PDF
FunctionalConf '16 Robert Virding Erlang Ecosystem
PDF
Learning Elixir as a Rubyist
PDF
Functional Programming With Elixir
PDF
The Ring programming language version 1.5.2 book - Part 5 of 181
PPTX
Introduction to functional programming, with Elixir
PPTX
A sip of elixir
PDF
The Ring programming language version 1.8 book - Part 6 of 202
PDF
The Ring programming language version 1.6 book - Part 6 of 189
PDF
The Ring programming language version 1.5.4 book - Part 5 of 185
PDF
The Ring programming language version 1.5.3 book - Part 5 of 184
PDF
The Ring programming language version 1.5.1 book - Part 4 of 180
PDF
The Ring programming language version 1.7 book - Part 6 of 196
PDF
The Ring programming language version 1.3 book - Part 4 of 88
PDF
Elixir and Phoenix for Rubyists
PDF
The Ring programming language version 1.2 book - Part 4 of 84
Elixir for aspiring Erlang developers
Elixir Programming Language 101
The Ring programming language version 1.10 book - Part 6 of 212
Elixir and elm
The Ring programming language version 1.9 book - Part 6 of 210
FunctionalConf '16 Robert Virding Erlang Ecosystem
Learning Elixir as a Rubyist
Functional Programming With Elixir
The Ring programming language version 1.5.2 book - Part 5 of 181
Introduction to functional programming, with Elixir
A sip of elixir
The Ring programming language version 1.8 book - Part 6 of 202
The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.5.4 book - Part 5 of 185
The Ring programming language version 1.5.3 book - Part 5 of 184
The Ring programming language version 1.5.1 book - Part 4 of 180
The Ring programming language version 1.7 book - Part 6 of 196
The Ring programming language version 1.3 book - Part 4 of 88
Elixir and Phoenix for Rubyists
The Ring programming language version 1.2 book - Part 4 of 84

Recently uploaded (20)

PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Digital Strategies for Manufacturing Companies
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
System and Network Administration Chapter 2
PDF
AI in Product Development-omnex systems
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
history of c programming in notes for students .pptx
PPTX
L1 - Introduction to python Backend.pptx
PDF
Nekopoi APK 2025 free lastest update
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
top salesforce developer skills in 2025.pdf
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Upgrade and Innovation Strategies for SAP ERP Customers
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Digital Strategies for Manufacturing Companies
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Which alternative to Crystal Reports is best for small or large businesses.pdf
Reimagine Home Health with the Power of Agentic AI​
System and Network Administration Chapter 2
AI in Product Development-omnex systems
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
history of c programming in notes for students .pptx
L1 - Introduction to python Backend.pptx
Nekopoi APK 2025 free lastest update
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
top salesforce developer skills in 2025.pdf
CHAPTER 2 - PM Management and IT Context
wealthsignaloriginal-com-DS-text-... (1).pdf
VVF-Customer-Presentation2025-Ver1.9.pptx

Elixir intro

  • 1. New software for new hardware Elixir meetup 4.0, Lviv, December 17, 2016 Elixir introduction
  • 2. Hello! I am Anton Mishchuk - Ruby developer at Matic Insurance - Elixir fan - Author and maintainer of ESpec BDD test framework Github: antonmi 2
  • 3. What I’d tell you ▪ No pictures, sorry ▪ No code samples ▪ No live coding ▪ Lots of philosophy ▪ Few words about Erlang and Elixir 3
  • 4. The plan ▪ Software crisis? ▪ Resurrection of FP ▪ Erlang ▪ Erlang concurrency model ▪ Elixir ▪ Elixir is not Ruby ▪ You should try Elixir 4
  • 6. Common characteristic of present software ▪ low quality ▪ very inefficient ▪ difficult to maintain 6
  • 7. Nathan Myhrvold’s laws ▪ “Software is a gas” ▪ “Software grows until it becomes limited by Moore’s Law” ▪ “Software growth makes Moore’s Law possible” ▪ “Software is only limited by human ambition and expectation” 7 Nathan Myhrvold, formerly CTO at Microsoft
  • 8. Niklaus Wirth’s Law: “Software gets slower faster than hardware gets faster” 8 Niklaus Wirth, computer scientist, designer of several PL (incl. Pascal)
  • 10. ▪ Better hardware? or ▪ Better software? 10
  • 11. We are experiencing a period of “dramatic changes” ▪ New hardware! ▪ New software! 11
  • 12. New hardware: ▪ Multicore systems ▪ ASIC (Application-specific integrated circuit) ▪ FPGA (Field-programmable gate array) 12 “The von Neumann Syndrome”
  • 13. New software: Multicore crisis: To take advantage of the additional cores most applications have to be rewritten 13
  • 15. Functional programming FP is a programming paradigm that treats computation as the evaluation of mathematical functions. FP: Data structures manipulated through functions OOP: Objects manipulated through methods 15
  • 16. FP concepts ▪ High-order functions ▪ Pure functions ▪ Recursions ▪ Lazy evaluations ▪ Currying ▪ Closures 16
  • 17. History FP: ▪ Lisp, 1950s ▪ APL, 1960s ▪ Haskell, late 80s ▪ Erlang, 1986 OOP: ▪ Simula, 1960s ▪ Smalltalk, 1970s ▪ Java, Ruby, 1995 17
  • 18. CPU: ▪ Single-processor machines ▪ 50%/year clock speed growth ▪ From ~10MHz to ~1GHz RAM: ▪ Relatively expensive and slow ▪ $100/1Mb in 1990. $1/1Mb in 2000 ▪ CPU cache OOP dominating in 90s 18
  • 19. ▪ Is OOP the only right way to to create software? ▪ Is OOP the RIGHT way? 19
  • 20. Why OO sucks? (c) Joe Armstrong 20
  • 21. ▪ Functions do things ▪ Data structures just are Since functions and data structures are completely different types of animal it is fundamentally incorrect to lock them up in the same cage. Objection 1: Data structure and functions should not be bound together 21
  • 22. ▪ Should “time” to be an instance of some type? ▪ Should a simple integer number to be an instance of some type? Objection 2: Everything has to be an object 22
  • 23. ▪ lots of types with limited amount of specific functions Isn't it better have a smallish number of ubiquitous data types and a large number of small functions that work on them? Objection 3: Data type definitions are spread out all over the place 23
  • 24. The state is hidden and visible only through access functions. State is the root of all evil! Objection 4: Objects have private state 24
  • 25. Why OO was popular? (c) Joe Armstrong 25
  • 26. ▪ It was thought to be easy to learn. ▪ It was thought to make code reuse easier. ▪ It was hyped. ▪ It created a new software industry. Why OO was popular? (c) Joe Armstrong 26
  • 27. I see no evidence of 1 and 2. Reasons 3 and 4 seem to be the driving force behind the technology. 27
  • 28. If a language technology is so bad that it creates a new industry to solve problems of its own making then it must be a good idea for the guys who want to make money. 28
  • 30. ▪ Elixir compiler is written in Erlang ▪ Both Elixir and Erlang compiles into BEAM byte code Elixir == Erlang 30
  • 31. ▪ Ericsson, 1986 ▪ Joe Armstrong, Robert Virding and Mike Williams ▪ Open-sourced in 1998 ▪ Telecom systems (telephone switches) ▪ The latest version is 19.1 Erlang 31
  • 32. ▪ Fault tolerance ▪ Scalability ▪ Distribution ▪ Live update Erlang buzzwords 32
  • 33. ▪ Ericsson ▪ WhatsApp ▪ Facebook ▪ Amazon ▪ Bet365 ▪ Demonware ▪ ... Companies using Erlang 33
  • 34. ▪ Modules ▪ Functions ▪ Primitive data types: atoms, integers, floats, tuples, lists, maps, strings, binaries, records, references, pids, ports, funs. Erlang components 34
  • 36. ▪ Native threads ▪ Green threads ▪ Event loop It is not about: 36
  • 37. ▪ lightweight processes ▪ with isolated memory ▪ communication via messages It is about “actors” 37
  • 38. In response to a message actor receives, can concurrently: ▪ send a finite number of messages to other actors ▪ create a finite number of new actors ▪ Set the “state” to be used for the next message it receives Actors 38
  • 39. ▪ Controlled by BEAM VM ▪ ~ 1µs to create process ▪ ~ 1kB memory per process ▪ ~ 1µs to pass a message Erlang actors 39
  • 40. ▪ encapsulate state ▪ communicate with other actors by exchanging messages More OO than objects 40
  • 41. ▪ Tools ▪ Libraries Design principles: ▪ Workers and Supervisors ▪ GenServer, GenFSM ▪ Event Handler and Manager ▪ Application Erlang OTP 41
  • 43. ▪ Jose Valim, 2012 ▪ Current version 1.3 ▪ Hex.pm ▪ >3000 packages, ~20000 down/day ▪ Elixir Conf EU, Elixir Conf US ▪ Elixir Companies ▪ Phoenix web framework (2M websocket conns) Elixir 43
  • 44. What is Elixir? 44 Elixir is Erlang with pretty syntax and metaprogramming ▪ Consistent stdlib ▪ Pipe operator ▪ Tools (mix, iex, logger)
  • 45. Elixir metaprogramming 45 ▪ Easy code sharing ▪ Perfect Ruby-like DSLs
  • 46. 6 Elixir is not Ruby 46
  • 47. Elixir is functional 47 ▪ Function is a primary Elixir abstraction. ▪ Data is immutable ▪ Minimal state manipulation
  • 48. Ruby is OO language with some FP features 48 ▪ Procs, lambdas ▪ No FP optimizations ▪ Data is mutable
  • 49. Concurrency model 49 In Ruby, one moves through a monolithic call stack, manipulating objects. Threads or fibers uses the same memory heap. Elixir processes have their own heaps, and the VM collects process' garbage independently of each other.
  • 50. What is the same? 50 “programmer happiness” philosophy: ▪ Pretty syntax ▪ Good documentation ▪ Tools for easy development
  • 51. 7 You should try Elixir 51
  • 52. Think about future software 52 ▪ Multi-core computers ▪ IoT with up to 30 billion devices to be online by 2020
  • 53. Double paradigm switch 53 ▪ Functional programming ▪ Actor concurrency model
  • 54. You’ll found it exciting 54 ▪ It’s easy to get started ▪ Lots of tutorials ▪ Nice documentation ▪ Great community