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
Building a game with Elixir and Elm
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Paulo Diniz
September 08, 2017
Programming
71
0
Share
Building a game with Elixir and Elm
Building a game with Elixir and Elm
Paulo Diniz
September 08, 2017
More Decks by Paulo Diniz
See All by Paulo Diniz
Functional Programming in FrontEnd
paulodiniz
0
130
Vim + tmux for Brazilian Training Center
paulodiniz
1
55
Other Decks in Programming
See All in Programming
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
770
Explore CoroutineScope
tomoeng11
0
190
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
3
1k
AI-DLC Deep Dive
yuukiyo
9
5.7k
Kingdom of the Machine
yui_knk
2
1.5k
要はバランスからの卒業 #yumemi_grow
kajitack
0
130
ふにゃっとしない名前の付け方 〜哲学で茹で上げる、コシのあるソフトウェア設計〜
shimomura
0
120
Building on Bluesky's AT Protocol with Ruby
mackuba
0
110
実用!Hono RPC2026
yodaka
2
310
t *testing.T は どこからやってくるの?
otakakot
1
930
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.9k
Agent Skills を社内で育てる仕組み作り
jackchuka
1
1.9k
Featured
See All Featured
Tell your own story through comics
letsgokoyo
1
920
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
The Cult of Friendly URLs
andyhume
79
6.9k
WENDY [Excerpt]
tessaabrams
10
37k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
350
What's in a price? How to price your products and services
michaelherold
247
13k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.1k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9k
How to Ace a Technical Interview
jacobian
281
24k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.6k
Speed Design
sergeychernyshev
33
1.6k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.1k
Transcript
Hi ! I'm Paulo
Born
Live
Work
Like
Like
Like
Like
Functional Programming Fits my mental map Many languages have it
It feels right for me
Elixir Enum.map(["1", "2", "3"], &(String.to_integer &1)) => [1, 2, 3]
Ruby ['1', '2', '3'].map(&:to_i) => [1, 2, 3]
Javascript ['1', '2', '3'].map(parseInt) => [ 1, NaN, NaN ]
Couldn't apply my mental models directly ! Note: Javascript community
❤ Note2: Underscore.js ❤ Note3: Ramda ❤ Note4: React ❤
Maybe I should try to use another language? Elm Clojurescript
PureScript ElixirScript
I used Elm to make a game
None
Elixir on server Phoenix websockets OTP Also matched my mental
model
updateFlappy : Game -> ( Game, Cmd Msg ) updateFlappy
game = game |> gravity |> physics |> upperLimit |> checkPipeColision |> updatePipes |> updateScore
updateScore : Game -> ( Game, Cmd Msg ) updateScore
game = let score = game.pipes |> List.filter (\pipe -> pipe.passed == True) |> List.length |> (\x -> x // 2) in if (game.score == score) then ( game, Cmd.none ) else { game | score = score } |> update SendScore
Server top_players = players |> Enum.sort(fn(p1, p2) -> p1.score >
p2.score end) |> Enum.take(3)
Wrapping up I'm not confortable with JS If you're also
not, try other languages Make games, they're awesome https://paulodiniz.github.io/flappy-bird/
Thank you twitter: @paulodiniz github: paulodiniz