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 a...
Search
José Tomás Albornoz
September 16, 2016
Programming
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
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
99
Introduction to Dokku
eljojo
1
170
Baruco 2014: How I Built My Own Twitch-Plays-Pokémon
eljojo
0
1.1k
Introduction to Docker
eljojo
0
250
Other Decks in Programming
See All in Programming
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
4
1.2k
自作OSでスライド発表する
uyuki234
1
3.9k
「正の参照」と 「負の導出」で組む ハーネスエンジニアリング
cottpan
1
150
1年で人数1.5倍、PR数5.5倍増。 品質とアウトカムはどうなったか、 何が効いたか
ike002jp
0
150
Android CLI
fornewid
0
170
Built Our Own Background Agent at LayerX #aidevex_findy
layerx
PRO
8
3.4k
AWS CDK を「作」ってみた 〜フルスクラッチで見えた CDK の裏側〜 / aws-cdk-from-scratch
gotok365
3
2.4k
全PRの83%がAIレビューだけでマージできるようになった開発組織はその後どうなったか
athug
0
380
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
500
5分で問診!Composer セキュリティ健康診断
codmoninc
0
600
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
400
Haskell/Servantを通してWebミドルウェアを捉え直す
pizzacat83
1
610
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Designing for Timeless Needs
cassininazir
1
400
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
160
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
200
Accessibility Awareness
sabderemane
1
160
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
470
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Test your architecture with Archunit
thirion
1
2.3k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
340
Documentation Writing (for coders)
carmenintech
77
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