Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Elixir - functional, concurrent, distributed programming for the rest of us
Search
Andrea Leopardi
October 26, 2018
Programming
2
290
Elixir - functional, concurrent, distributed programming for the rest of us
Andrea Leopardi
October 26, 2018
Tweet
Share
More Decks by Andrea Leopardi
See All by Andrea Leopardi
The World is a Network (and We Are Just Nodes)
whatyouhide
0
97
BEAM: The Perfect Fit for Networks
whatyouhide
1
130
Update from the Elixir team - 2022
whatyouhide
0
330
Testing Asynchronous OTP
whatyouhide
0
440
Elixir Sightseeing Tour
whatyouhide
0
330
Mint - Disrupting HTTP clients
whatyouhide
0
200
BEAM Architecture Handbook
whatyouhide
7
2.5k
The Evolution of a Language
whatyouhide
0
110
Papers we love: Elixir edition
whatyouhide
5
970
Other Decks in Programming
See All in Programming
Escolhendo (ou não) o melhor ORM para o seu projeto
andreiacsilva
1
140
freeeのエンジニアが 就活で出そうな コーディングテストを 解説してみる
freee
0
140
TCAとKMPを用いた新規動画配信アプリ 「ABEMA Live」の設計
tomu28
2
140
ts-morphを使ってコードリプレイスとASTへのハードルを下げる!
nyawach
5
320
AmperとFleetを使ったAndroidアプリ
yoppie
0
300
Amazon Aurora Serverless v2が意外と高かった話と、AWS Database Migration Serviceの話
satoshi256kbyte
1
110
Open standards for building event-driven applications in the cloud
meteatamel
0
210
株式会社ゼネテック
genetec
0
120
哲学史とモデリング
tanakahisateru
2
380
Powerfully Typed TypeScript
euxn23
3
1.2k
Native Federation: The Future of Micro Frontends in Angular
manfredsteyer
PRO
0
160
Productivity is Messing Around and Having Fun
hollycummins
1
170
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
61
6.7k
Large-scale JavaScript Application Architecture
addyosmani
504
110k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
188
16k
What's in a price? How to price your products and services
michaelherold
238
11k
Building Adaptive Systems
keathley
32
1.9k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
34
6.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
358
22k
Writing Fast Ruby
sferik
622
60k
Pencils Down: Stop Designing & Start Developing
hursman
117
11k
4 Signs Your Business is Dying
shpigford
176
21k
Making the Leap to Tech Lead
cromwellryan
125
8.6k
10 Git Anti Patterns You Should be Aware of
lemiorhan
649
58k
Transcript
functional, concurrent, distributed programming for the rest of us ELIXIR
@whatyouhide
None
None
None
None
functional, concurrent, distributed programming for the rest of us ELIXIR
LET'S BUILD A LANGUAGE
Language for modern systems
None
concurrent distributed fault-tolerant extensible
don't give to devs, enable devs
VM
NO TYPE SYSTEM
CONCURRENCY
threads are heavy
schedulers VM processes
memory memory
IMMUTABLE DATA
MESSAGE PASSING
send(pid, message) receive do ... end +
None
pattern matching
{1, _} = some_tuple
receive do {1, _} -> ... {_, _} -> ...
end
None
case expression do pattern1 -> ... pattern2 -> ... _
-> ... end
ISOLATED MEMORY MESSAGE PASSING +
None
def loop(state) do receive do new_state -> loop(new_state) end end
DISTRIBUTION
node 1 node 2
FAULT TOLERANCE
acceptor
acceptor
None
None
link
link
link
link trap crash
link trap crash trap crash
None
None
SUPERVISORS
None
None
None
None
SYNTAX
github.com/josevalim/lego-lang
def(double_sum(a, b), do: ( =(c, +(a, b)) *(c, 2) ))
def(double_sum(a, b), do: ( =(c, +(a, b)) *(c, 2) ))
def(double_sum(a, b), do: ( =(c, +(a, b)) *(c, 2) ))
def(double_sum(a, b), do: ( =(c, +(a, b)) *(c, 2) ))
if(>(a, b), do: a, else: b)
macros functions +
less parens?
def(double_sum(a, b), do: ( =(c, +(a, b)) *(c, 2) ))
def(double_sum(a, b), do: ( c = a + b c
* 2 ))
def double_sum(a, b), do: ( c = a + b
c * 2 )
def double_sum(a, b) do c = a + b c
* 2 end
if a > b do a else b end
literals and containers
[1, 2, 3] [](1, 2, 3)
macros functions +
def add(a, b), do: a + b
defmacro def(call, keywords) add(a, b) do: (a + b)
case expression do true -> branch1 else -> branch2 end
defmacro if(condition, do: branch1, else: branch2) do quote do case
unquote(condition) do true -> unquote(branch1) false -> unquote(branch2) end end end
CONLCLUSION
PLOT TWIST... we built ELIXIR
concurrent distrubuted fault-tolerant extensible
elixir-lang.org @whatyouhide