$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Building a game with Elixir and Elm
Search
Paulo Diniz
September 08, 2017
Programming
0
69
Building a game with Elixir and Elm
Building a game with Elixir and Elm
Paulo Diniz
September 08, 2017
Tweet
Share
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
51
Other Decks in Programming
See All in Programming
AI 駆動開発ライフサイクル(AI-DLC):ソフトウェアエンジニアリングの再構築 / AI-DLC Introduction
kanamasa
11
3.4k
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
160
Microservices rules: What good looks like
cer
PRO
0
1.6k
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
560
Navigating Dependency Injection with Metro
l2hyunwoo
1
170
Flutter On-device AI로 완성하는 오프라인 앱, 박제창 @DevFest INCHEON 2025
itsmedreamwalker
1
140
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
140
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
230
Deno Tunnel を使ってみた話
kamekyame
0
220
SwiftUIで本格音ゲー実装してみた
hypebeans
0
480
The Art of Re-Architecture - Droidcon India 2025
siddroid
0
120
Socio-Technical Evolution: Growing an Architecture and Its Organization for Fast Flow
cer
PRO
0
390
Featured
See All Featured
Between Models and Reality
mayunak
0
150
Paper Plane (Part 1)
katiecoart
PRO
0
1.9k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
190
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
130
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
WCS-LA-2024
lcolladotor
0
380
The Curse of the Amulet
leimatthew05
0
4.6k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
66
Designing for Timeless Needs
cassininazir
0
88
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
980
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.6k
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