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
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
130
Vim + tmux for Brazilian Training Center
paulodiniz
1
55
Other Decks in Programming
See All in Programming
技術記事、 専門家としてのプログラマ、 言語化
mizchi
13
6.6k
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.3k
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
610
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
4
1.5k
Contextとはなにか
chiroruxx
1
380
Oxcを導入して開発体験が向上した話
yug1224
4
340
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
280
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
810
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
980
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
1
520
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
180
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
790
Featured
See All Featured
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
210
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
140
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
570
The Cost Of JavaScript in 2023
addyosmani
55
10k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4k
Mind Mapping
helmedeiros
PRO
1
260
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
A Soul's Torment
seathinner
6
3k
KATA
mclloyd
PRO
35
15k
Optimising Largest Contentful Paint
csswizardry
37
3.7k
Accessibility Awareness
sabderemane
1
140
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