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
what is this elixir thing everyone is talking about
Search
José Tomás Albornoz
September 16, 2016
Programming
0
120
what is this elixir thing everyone is talking about
some of my fav features of elixir
lightning talk for CodeDaze.io on September 16th, 2016
José Tomás Albornoz
September 16, 2016
Tweet
Share
More Decks by José Tomás Albornoz
See All by José Tomás Albornoz
Things I learned when working on a small startup
eljojo
0
72
Introduction to Dokku
eljojo
1
130
Baruco 2014: How I Built My Own Twitch-Plays-Pokémon
eljojo
0
730
Introduction to Docker
eljojo
0
200
Other Decks in Programming
See All in Programming
Next.js で SPA を構築する際の辛み
hayatow
0
220
【KMC春合宿2024】実装視点で見るNeural Radiance Fields
runningoutrate
0
130
Material 3で Material 2ぽい見た目にする
numeroanddev
2
220
BuefyのMaintainerを引き継いだ件
kikuomax
0
330
私がエッジを使う理由
chimame
9
3.6k
Deep Dive 大規模システムアーキテクチャ/開発組織エンジニアリング / Deep Dive Large-Scale System Architecture, Development Organization Engineering
nrslib
4
430
導入から5年が経って見えた Datadog APM 運用の課題
bgpat
1
480
期限が近づいてきた!Privacy Manifests対応
ryunakayama
5
3k
PHPでOfficeファイルを取り扱う! PHP Officeライブラリを プロダクトに組み込んだ話
hirobe1999
0
730
人口ダッシュボード作成講座資料
jo76shin
0
170
スタートアップのフロントエンド事情 GENBA #2 〜Front-End Opsの現場〜
ebijun1007
1
780
Apple Vision Pro購入RTA 1泊3日弾丸ハワイツアー / RTA: Purchase Apple Vision Pro in Hawaii
yutailang0119
0
480
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
7
2.3k
A Tale of Four Properties
chriscoyier
150
22k
Happy Clients
brianwarren
91
6.3k
Gamification - CAS2011
davidbonilla
76
4.5k
Unsuck your backbone
ammeep
660
56k
10 Git Anti Patterns You Should be Aware of
lemiorhan
644
57k
What's new in Ruby 2.0
geeforr
335
31k
Designing for Performance
lara
601
67k
GraphQLとの向き合い方2022年版
quramy
28
12k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
240
1.2M
Being A Developer After 40
akosma
56
580k
Making Projects Easy
brettharned
106
5.4k
Transcript
what is this elixir thing everyone's talking about by jojo
what is elixir
elixir is a functional language
created by José Valim
that runs on the erlang vm
pattern matching iex(1)> [first, second] = [1, 2] [1, 2]
iex(2)> first 1
pattern matching iex(2)> [first, second] = [1,2,3] ** (MatchError) no
match of right hand side value: [1, 2, 3]
pattern matching iex(1)> payload = %{username: "eljojo", stuff: true} %{stuff:
true, username: "eljojo"} iex(2)> %{username: name} = payload %{stuff: true, username: "eljojo"} iex(3)> name "eljojo"
function overloading def make_sound(:cow) do IO.puts "MOOOOOOOOO" end def make_sound(:cat)
do IO.puts "MEEEOOWW" end def make_sound(_) do IO.puts "¯\_(ϑ)_/¯" end
function overloading def make_sound(%{animal: :cow}) do IO.puts "MOOOOOOOOO" end def
make_sound(%{animal: :cat}) do IO.puts "MEEEOOWW" end def make_sound(%{animal: name}) do IO.puts "not sure how to #{name} ¯\_(ϑ)_/¯" end
we also got guards def page_ops(downtime) when downtime < 10
do IO.puts "¯\_(ϑ)_/¯" end def page_ops(downtime) when downtime >= 10 do PagerDuty.notify(whatever) end
pipe operator def add_one(number), do: number + 1 def multiply_by_three(number),
do: number * 3 multiply_by_three(add_one(1)) # => 6
pipe operator def add_one(number), do: number + 1 def multiply_by_three(number),
do: number * 3 1 |> add_one |> multiply_by_three # => 6
processes + messages current_process = self() spawn_link(fn -> send(current_process, {:msg,
"hello world"}) end) receive do {:msg, contents} -> IO.puts contents end
processes + messages # machine one receive do {:msg, contents}
-> IO.puts contents end # machine two process_name = "$MACHINE_ONE" spawn_link(fn -> send(process_name, {:msg, "yo!"}) end)
what is phoenix
A productive web framework that does not compromise speed and
maintainability.
it's basically rails for elixir, but cooler
validations def changeset(struct, params \\ %{}) do struct |> cast(params,
[:email_address, :first_name]) |> validate_required([:email_address]) end def changeset_after_signup(struct, params \\ %{}) do changeset(struct, params) |> validate_required([:first_name]) end
we're hiring!
@eljojo