Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Building a game with Elixir and Elm
Search
Paulo Diniz
September 08, 2017
Programming
73
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
140
Vim + tmux for Brazilian Training Center
paulodiniz
1
58
Other Decks in Programming
See All in Programming
JIS keyboard support in Omarchy
lef237
0
120
dotNET_vulnclicker_intro.pdf
deka_morita
0
140
AmebaブログはKMPから卒業します
kmars0605
0
190
すこし踏み込む CancellationToken
htkym
2
1.7k
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.2k
contenteditable と日本語入力に向き合う
colorful12
0
200
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
390
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
0
140
残高管理から台帳サービスへの進化
artoy
1
200
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
160
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
790
Featured
See All Featured
The Curious Case for Waylosing
cassininazir
1
570
HDC tutorial
michielstock
2
960
Automating Front-end Workflow
addyosmani
1369
210k
Faster Mobile Websites
deanohume
310
32k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
930
Exploring anti-patterns in Rails
aemeredith
4
540
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.4k
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