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
0
88
A Brief Introduction to Elixir
Lightning talk presented in DaWanda
Iuri Fernandes
March 11, 2016
Tweet
Share
More Decks by Iuri Fernandes
See All by Iuri Fernandes
Comredis
iurifq
1
90
Phoenix channels introduction
iurifq
0
110
Git - Dicas e boas práticas
iurifq
0
710
Vim
iurifq
1
140
Other Decks in Technology
See All in Technology
watsonx.ai Dojo #5 ファインチューニングとInstructLAB
oniak3ibm
PRO
0
290
生成AIをより賢く エンジニアのための RAG入門 - Oracle AI Jam Session #20
kutsushitaneko
4
340
20241218_今年はSLI/SLOの導入を頑張ってました!
zepprix
0
220
The key to VCP-VCF
mirie_sd
0
110
pg_bigmをRustで実装する(第50回PostgreSQLアンカンファレンス@オンライン 発表資料)
shinyakato_
0
130
効率的な技術組織が作れる!書籍『チームトポロジー』要点まとめ
iwamot
2
170
Oracle Cloudの生成AIサービスって実際どこまで使えるの? エンジニア目線で試してみた
minorun365
PRO
5
330
20241125 - AI 繪圖實戰魔法工作坊 @ 實踐大學
dpys
1
370
re:Invent をおうちで楽しんでみた ~CloudWatch のオブザーバビリティ機能がスゴい!/ Enjoyed AWS re:Invent from Home and CloudWatch Observability Feature is Amazing!
yuj1osm
0
150
メンタル面でもつよつよエンジニアになる/登壇資料(井田 献一朗)
hacobu
0
150
AWS環境におけるランサムウェア攻撃対策の設計
nrinetcom
PRO
1
290
スケールし続ける事業とサービスを支える組織とアーキテクチャの生き残り戦略 / The survival strategy for Money Forward’s engineering.
moneyforward
0
160
Featured
See All Featured
Visualization
eitanlees
146
15k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.7k
Building Your Own Lightsaber
phodgson
104
6.1k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Making the Leap to Tech Lead
cromwellryan
133
9k
BBQ
matthewcrist
85
9.4k
The Cost Of JavaScript in 2023
addyosmani
46
7k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
930
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
The Invisible Side of Design
smashingmag
299
50k
Building an army of robots
kneath
302
44k
Code Reviewing Like a Champion
maltzj
521
39k
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?