SlideShare a Scribd company logo
1 of 15
Download to read offline
WHY ELM?WHY ELM?
SCOTT SMITHSCOTT SMITH
SCOTTNELSONSMITH@GMAIL.COMSCOTTNELSONSMITH@GMAIL.COM
WHY ELM EXIST??WHY ELM EXIST??
Purpose: "writing great code should be easy … now it is"
How: "the best of functional programming in your browser"
Example: "Hello World"
WHY ELM LANGUAGE?WHY ELM LANGUAGE?
Elm Syntax
Core Language
WHY ELM LIBRARIES?WHY ELM LIBRARIES?
Rendering
Effects
elm-http
start-app
elm-effecs
elm-html
elm-svg
elm-markdown
elm-webgl
Core
WHY ELM RELIABILITY?WHY ELM RELIABILITY?
Contracts
Enumerations
State Machines
Tagged Unions
Banishing NULL
Recursive Data Structures
Precisely model the problem!
WHY ELM EXAMPLES?WHY ELM EXAMPLES?
Graphics
Games
WHY ELM GRAPHICS?WHY ELM GRAPHICS?
Build in concepual layers
shape outline the shape
form "fill in" shape using texture
collage render List of form in rectangular area
Html convert collage to HTML elements
GRAPHICS EXAMPLEGRAPHICS EXAMPLE
import Html exposing (text)
import Graphics.Collage exposing (..)
import Graphics.Element exposing (..)
import Color exposing (lightBrown)
main =
Html.fromElement (collage 200 200 [
filled lightBrown (ngon 4 50)
])
GRAPHICS EXMAPLE USING ELIXIR PIPEGRAPHICS EXMAPLE USING ELIXIR PIPE
tho it's called a forward function in Elm
import Html exposing (text)
import Graphics.Collage exposing (..)
import Graphics.Element exposing (..)
import Color exposing (lightBrown)
main =
ngon 4 50
|> filled lightBrown
|> List.repeat 1
|> collage 200 200
|> Html.fromElement
WHY ELM GAMES?WHY ELM GAMES?
( )GitHub
Mario
Pong
Froggy
WHY ELM ARCHITETURE?WHY ELM ARCHITETURE?
-- MODEL
type alias Model = { ... }
-- UPDATE
type Action = Reset | ...
update : Action -> Model -> Model
update action model =
case action of
Reset -> ...
...
-- VIEW
view : Model -> Html
view =
...
WHY ELM SIGNALS?WHY ELM SIGNALS?
type alias Model = Int
type Action = Increment | Decrement
update : Action -> Model -> Model
update action model =
case action of
Increment -> model + 1
Decrement -> model - 1
view : Signal.Address Action -> Model -> Html
view address model =
div []
[ button [ onClick address Decrement ] [ text "-" ]
, div [ countStyle ] [ text (toString model) ]
, button [ onClick address Increment ] [ text "+" ]
]
Running Code!
WHY ELM REACTIVE?WHY ELM REACTIVE?
WHY ELM FOR ME?WHY ELM FOR ME?
Javascript is general purpose – no "point of view"
Functional programming: creativity through constraints
Hoping it guides me on building a non-trivial 2D game
WHY LEARN ELM?WHY LEARN ELM?
Weekly Elm Hacking Session
Saturday mornings 10:00-noon (starting May 7)
Here
Emphasis on client functional programming
Game development
Sophisticated user experience
Integration w/ Elixir/Phoenix

More Related Content

What's hot

Windows presentation foundation
Windows presentation foundationWindows presentation foundation
Windows presentation foundationNaga Harish M
 
Windows Presentation Foundation & XAML
Windows Presentation Foundation & XAMLWindows Presentation Foundation & XAML
Windows Presentation Foundation & XAMLAlex Sooraj
 
How to add watermark to image using php
How to add watermark to image using phpHow to add watermark to image using php
How to add watermark to image using phpYourBlogCoach1
 
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...Codemotion
 
John Murray :: Think Do Keep
John Murray :: Think Do KeepJohn Murray :: Think Do Keep
John Murray :: Think Do Keepgeorge.james
 

What's hot (7)

Windows presentation foundation
Windows presentation foundationWindows presentation foundation
Windows presentation foundation
 
Windows Presentation Foundation & XAML
Windows Presentation Foundation & XAMLWindows Presentation Foundation & XAML
Windows Presentation Foundation & XAML
 
How to add watermark to image using php
How to add watermark to image using phpHow to add watermark to image using php
How to add watermark to image using php
 
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...
 
Vba part 1
Vba part 1Vba part 1
Vba part 1
 
John Murray :: Think Do Keep
John Murray :: Think Do KeepJohn Murray :: Think Do Keep
John Murray :: Think Do Keep
 
Vba Class Level 1
Vba Class Level 1Vba Class Level 1
Vba Class Level 1
 

Similar to What About Elm?

Rethink Frontend Development With Elm
Rethink Frontend Development With ElmRethink Frontend Development With Elm
Rethink Frontend Development With ElmBrian Hogan
 
Rethink Frontend Development With Elm
Rethink Frontend Development With ElmRethink Frontend Development With Elm
Rethink Frontend Development With ElmBrian Hogan
 
Elm, the runtime error killer
Elm, the runtime error killerElm, the runtime error killer
Elm, the runtime error killerJordy Moos
 
Phoenix with Elm
Phoenix with ElmPhoenix with Elm
Phoenix with Elm이재철
 
Erik Wendel - Beyond JavaScript Frameworks: Writing Reliable Web Apps With El...
Erik Wendel - Beyond JavaScript Frameworks: Writing Reliable Web Apps With El...Erik Wendel - Beyond JavaScript Frameworks: Writing Reliable Web Apps With El...
Erik Wendel - Beyond JavaScript Frameworks: Writing Reliable Web Apps With El...Codemotion
 
Writing Game Servers with Elixir
Writing Game Servers with ElixirWriting Game Servers with Elixir
Writing Game Servers with ElixirSmartLogic
 
Oracle Enterprise Manager 12c: EMCLI Crash Course
Oracle Enterprise Manager 12c: EMCLI Crash CourseOracle Enterprise Manager 12c: EMCLI Crash Course
Oracle Enterprise Manager 12c: EMCLI Crash CourseGokhan Atil
 
01 concepts of_object-orientation (1)
01 concepts of_object-orientation (1)01 concepts of_object-orientation (1)
01 concepts of_object-orientation (1)AaDi RA
 
Play with elm - Choucri fahed, Finstack - Lambadays
Play with elm - Choucri fahed, Finstack - LambadaysPlay with elm - Choucri fahed, Finstack - Lambadays
Play with elm - Choucri fahed, Finstack - LambadaysFinstack
 
Make Yourself a Happy Front-end Web Developer with Elm.
Make Yourself a Happy Front-end Web Developer with Elm.Make Yourself a Happy Front-end Web Developer with Elm.
Make Yourself a Happy Front-end Web Developer with Elm.Froyo Framework
 
Elm: Make Yourself A Happy Front-end Web Developer
Elm: Make Yourself A Happy Front-end Web DeveloperElm: Make Yourself A Happy Front-end Web Developer
Elm: Make Yourself A Happy Front-end Web DeveloperAsep Bagja
 
Functional programming and Elm
Functional programming and ElmFunctional programming and Elm
Functional programming and ElmFangda Wang
 
EMF - The off beat path
EMF - The off beat pathEMF - The off beat path
EMF - The off beat path17thcamel
 
MVP Mix 2015 Leveraging MVVM on all Platforms
MVP Mix 2015  Leveraging MVVM on all PlatformsMVP Mix 2015  Leveraging MVVM on all Platforms
MVP Mix 2015 Leveraging MVVM on all PlatformsJames Montemagno
 
Strongly Typed Data for Machine Learning
Strongly Typed Data for Machine LearningStrongly Typed Data for Machine Learning
Strongly Typed Data for Machine LearningVaticle
 
Elm 0.17 at Dublin Elm Meetup May 2016
Elm 0.17 at Dublin Elm Meetup May 2016Elm 0.17 at Dublin Elm Meetup May 2016
Elm 0.17 at Dublin Elm Meetup May 2016Michael Twomey
 
Programming in UML: Why and How
Programming in UML: Why and HowProgramming in UML: Why and How
Programming in UML: Why and HowEd Seidewitz
 

Similar to What About Elm? (20)

Rethink Frontend Development With Elm
Rethink Frontend Development With ElmRethink Frontend Development With Elm
Rethink Frontend Development With Elm
 
Rethink Frontend Development With Elm
Rethink Frontend Development With ElmRethink Frontend Development With Elm
Rethink Frontend Development With Elm
 
Elm, the runtime error killer
Elm, the runtime error killerElm, the runtime error killer
Elm, the runtime error killer
 
Phoenix with Elm
Phoenix with ElmPhoenix with Elm
Phoenix with Elm
 
Elm intro
Elm introElm intro
Elm intro
 
Erik Wendel - Beyond JavaScript Frameworks: Writing Reliable Web Apps With El...
Erik Wendel - Beyond JavaScript Frameworks: Writing Reliable Web Apps With El...Erik Wendel - Beyond JavaScript Frameworks: Writing Reliable Web Apps With El...
Erik Wendel - Beyond JavaScript Frameworks: Writing Reliable Web Apps With El...
 
Elm dev front-end
Elm   dev front-endElm   dev front-end
Elm dev front-end
 
Writing Game Servers with Elixir
Writing Game Servers with ElixirWriting Game Servers with Elixir
Writing Game Servers with Elixir
 
Oracle Enterprise Manager 12c: EMCLI Crash Course
Oracle Enterprise Manager 12c: EMCLI Crash CourseOracle Enterprise Manager 12c: EMCLI Crash Course
Oracle Enterprise Manager 12c: EMCLI Crash Course
 
01 concepts of_object-orientation (1)
01 concepts of_object-orientation (1)01 concepts of_object-orientation (1)
01 concepts of_object-orientation (1)
 
Play with elm - Choucri fahed, Finstack - Lambadays
Play with elm - Choucri fahed, Finstack - LambadaysPlay with elm - Choucri fahed, Finstack - Lambadays
Play with elm - Choucri fahed, Finstack - Lambadays
 
Make Yourself a Happy Front-end Web Developer with Elm.
Make Yourself a Happy Front-end Web Developer with Elm.Make Yourself a Happy Front-end Web Developer with Elm.
Make Yourself a Happy Front-end Web Developer with Elm.
 
Elm: Make Yourself A Happy Front-end Web Developer
Elm: Make Yourself A Happy Front-end Web DeveloperElm: Make Yourself A Happy Front-end Web Developer
Elm: Make Yourself A Happy Front-end Web Developer
 
Functional programming and Elm
Functional programming and ElmFunctional programming and Elm
Functional programming and Elm
 
EMF - The off beat path
EMF - The off beat pathEMF - The off beat path
EMF - The off beat path
 
Elm @ DublinJS
Elm @ DublinJSElm @ DublinJS
Elm @ DublinJS
 
MVP Mix 2015 Leveraging MVVM on all Platforms
MVP Mix 2015  Leveraging MVVM on all PlatformsMVP Mix 2015  Leveraging MVVM on all Platforms
MVP Mix 2015 Leveraging MVVM on all Platforms
 
Strongly Typed Data for Machine Learning
Strongly Typed Data for Machine LearningStrongly Typed Data for Machine Learning
Strongly Typed Data for Machine Learning
 
Elm 0.17 at Dublin Elm Meetup May 2016
Elm 0.17 at Dublin Elm Meetup May 2016Elm 0.17 at Dublin Elm Meetup May 2016
Elm 0.17 at Dublin Elm Meetup May 2016
 
Programming in UML: Why and How
Programming in UML: Why and HowProgramming in UML: Why and How
Programming in UML: Why and How
 

Recently uploaded

React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxnada99848
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 

Recently uploaded (20)

React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptx
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 

What About Elm?

  • 1. WHY ELM?WHY ELM? SCOTT SMITHSCOTT SMITH SCOTTNELSONSMITH@GMAIL.COMSCOTTNELSONSMITH@GMAIL.COM
  • 2. WHY ELM EXIST??WHY ELM EXIST?? Purpose: "writing great code should be easy … now it is" How: "the best of functional programming in your browser" Example: "Hello World"
  • 3. WHY ELM LANGUAGE?WHY ELM LANGUAGE? Elm Syntax Core Language
  • 4. WHY ELM LIBRARIES?WHY ELM LIBRARIES? Rendering Effects elm-http start-app elm-effecs elm-html elm-svg elm-markdown elm-webgl Core
  • 5. WHY ELM RELIABILITY?WHY ELM RELIABILITY? Contracts Enumerations State Machines Tagged Unions Banishing NULL Recursive Data Structures Precisely model the problem!
  • 6. WHY ELM EXAMPLES?WHY ELM EXAMPLES? Graphics Games
  • 7. WHY ELM GRAPHICS?WHY ELM GRAPHICS? Build in concepual layers shape outline the shape form "fill in" shape using texture collage render List of form in rectangular area Html convert collage to HTML elements
  • 8. GRAPHICS EXAMPLEGRAPHICS EXAMPLE import Html exposing (text) import Graphics.Collage exposing (..) import Graphics.Element exposing (..) import Color exposing (lightBrown) main = Html.fromElement (collage 200 200 [ filled lightBrown (ngon 4 50) ])
  • 9. GRAPHICS EXMAPLE USING ELIXIR PIPEGRAPHICS EXMAPLE USING ELIXIR PIPE tho it's called a forward function in Elm import Html exposing (text) import Graphics.Collage exposing (..) import Graphics.Element exposing (..) import Color exposing (lightBrown) main = ngon 4 50 |> filled lightBrown |> List.repeat 1 |> collage 200 200 |> Html.fromElement
  • 10. WHY ELM GAMES?WHY ELM GAMES? ( )GitHub Mario Pong Froggy
  • 11. WHY ELM ARCHITETURE?WHY ELM ARCHITETURE? -- MODEL type alias Model = { ... } -- UPDATE type Action = Reset | ... update : Action -> Model -> Model update action model = case action of Reset -> ... ... -- VIEW view : Model -> Html view = ...
  • 12. WHY ELM SIGNALS?WHY ELM SIGNALS? type alias Model = Int type Action = Increment | Decrement update : Action -> Model -> Model update action model = case action of Increment -> model + 1 Decrement -> model - 1 view : Signal.Address Action -> Model -> Html view address model = div [] [ button [ onClick address Decrement ] [ text "-" ] , div [ countStyle ] [ text (toString model) ] , button [ onClick address Increment ] [ text "+" ] ] Running Code!
  • 13. WHY ELM REACTIVE?WHY ELM REACTIVE?
  • 14. WHY ELM FOR ME?WHY ELM FOR ME? Javascript is general purpose – no "point of view" Functional programming: creativity through constraints Hoping it guides me on building a non-trivial 2D game
  • 15. WHY LEARN ELM?WHY LEARN ELM? Weekly Elm Hacking Session Saturday mornings 10:00-noon (starting May 7) Here Emphasis on client functional programming Game development Sophisticated user experience Integration w/ Elixir/Phoenix