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
A Brief Introduction to Elixir
Search
Iuri Fernandes
March 11, 2016
Technology
110
0
Share
A Brief Introduction to Elixir
Lightning talk presented in DaWanda
Iuri Fernandes
March 11, 2016
More Decks by Iuri Fernandes
See All by Iuri Fernandes
Comredis
iurifq
1
99
Phoenix channels introduction
iurifq
0
120
Git - Dicas e boas práticas
iurifq
0
750
Vim
iurifq
1
150
Other Decks in Technology
See All in Technology
スクラムを支える内部品質の話
iij_pr
0
300
Databricks Appsで実現する社内向けAIアプリ開発の効率化
r_miura
0
330
Databricks Lakebaseを用いたAIエージェント連携
daiki_akimoto_nttd
0
170
ふりかえりを 「あそび」にしたら、 学習が勝手に進んだ / Playful Retros Drive Learning
katoaz
0
340
GitHub Actions侵害 — 相次ぐ事例を振り返り、次なる脅威に備える
flatt_security
13
7.7k
New CBs New Challenges
ysuzuki
1
140
20260410 - CNTUG meetup #72 - DiskImage Builder 介紹:以 Kubespray CI 打造 RockyLinux 10 Cloud Image 為例
tico88612
0
100
仕様通り動くの先へ。Claude Codeで「使える」を検証する
gotalab555
8
2.9k
「できない」のアウトプット 同人誌『精神を壊してからの』シリーズ出版を 通して得られたこと
comi190327
3
600
Kubernetes基盤における開発者体験 とセキュリティの両⽴ / Balancing developer experience and security in a Kubernetes-based environment
chmikata
0
200
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
10
77k
GitHub Copilotを極める会 - 開発者のための活用術
findy_eventslides
5
3.3k
Featured
See All Featured
Abbi's Birthday
coloredviolet
2
6.4k
Crafting Experiences
bethany
1
110
The Invisible Side of Design
smashingmag
302
51k
How STYLIGHT went responsive
nonsquared
100
6k
Statistics for Hackers
jakevdp
799
230k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
120
Measuring & Analyzing Core Web Vitals
bluesmoon
9
800
Become a Pro
speakerdeck
PRO
31
5.9k
Ruling the World: When Life Gets Gamed
codingconduct
0
190
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
250
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Transcript
Iuri Fernandes A Brief Introduction to Elixir
Elixir! • Runs on Erlang VM • Cool language •
But before…
The problem • Telecommunications • Fast • Fault tolerant •
Distributed
Erlang and Telecom • Designed for telecom problems • OTP(Open
Telecom Platform)
Slide from José Valim’s presentations
Slide from José Valim’s presentations
BEAM • Erlang VM • Processes are units of computation
• Message passing FTW
Image from “Learn you some Erlang for great good” licensed
under Creative Commons Messages
OTP • Framework • Concurrent and distributed applications • Models
behaviors for processes • And much more …
OTP Examples Image from “Learn you some Erlang for great
good” licensed under Creative Commons
Image from “Learn you some Erlang for great good” licensed
under Creative Commons OTP Examples
Image from “Learn you some Erlang for great good” licensed
under Creative Commons OTP Examples
Elixir • Created in 2012 by José Valim • Functional
(Immutability) • Dynamically typed • Metaprogramming • Fresh life to Erlang ecosystem • BEAM VM
Drops of Elixir defmodule MyModule do def increment(argument) do argument
+ 1 end end defmodule PatternMatching do def head([]), do: nil def head([head | _]), do: head end
Drops of Elixir defmodule MyModule do def increment(x) when is_integer(x)
do x + 1 end end defmodule PatternMatching do def head([]), do: nil def head([head | _]), do: head end
Drops of Elixir parent = self() # Spawns an Elixir
process (not an operating system one!) spawn_link(fn -> send parent, {:msg, "hello world"} end) # Block until the message is received receive do {:msg, contents} -> IO.puts contents end
Drops of Elixir defmodule Stack do use GenServer # Callbacks
def handle_call(:pop, _from, [h|t]) do {:reply, h, t} end def handle_cast({:push, item}, state) do {:noreply, [item|state]} end end
Drops of Elixir # Start the server {:ok, pid} =
GenServer.start_link(Stack, [:hello]) # This is the client GenServer.call(pid, :pop) #=> :hello GenServer.cast(pid, {:push, :world}) #=> :ok GenServer.call(pid, :pop) #=> :world
Applications • Chat web app with Phoenix • Embedded systems
with Nerves • Pusher app replacement with Poxa
https://github.com/doomspork/elixir-companies Who uses it
None
None
Questions?