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
100
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
ハーネスエンジニアリングをやりすぎた話 ~そのハーネスは解体された~
gotalab555
5
1.9k
AgentCore×VPCでの設計パターンn選と勘所
har1101
4
340
M5Stack CoreS3とZephyr(RTOS)で Edge AIっぽいことしてみた
iotengineer22
0
380
AI時代における技術的負債への取り組み
codenote
1
1.8k
AI活用時代の事業判断高度化を導くエンジニアリング基盤 / 20260424 Atsushi Funahashi
shift_evolve
PRO
2
100
ネットワーク運用を楽にするAWS DevOps Agent活用法!! / 20260421 Masaki Okuda
shift_evolve
PRO
2
240
UIライブラリに依存しすぎないReact Native設計を目指して
grandbig
0
150
独断と偏見で試してみる、 シングル or マルチエージェント どっちがいいの?
shichijoyuhi
1
190
Anthropic「Long-running a gents」をGeminiで再現してみた
tkikuchi
0
650
AI와 협업하는 조직으로의 여정
arawn
0
540
Route 53 Global Resolver で高額課金発生!
otanikohei2023
0
130
色を視る
yuzneri
0
240
Featured
See All Featured
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
180
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.9k
Typedesign – Prime Four
hannesfritz
42
3k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
310
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
530
We Have a Design System, Now What?
morganepeng
55
8.1k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.4k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
310
New Earth Scene 8
popppiees
3
2.1k
What's in a price? How to price your products and services
michaelherold
247
13k
BBQ
matthewcrist
89
10k
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?