SlideShare a Scribd company logo
1 of 22
Download to read offline
Play with Elm!
Rethink Web Development
About Me
Choucri FAHED
CTO of Finstack
Scala, FP, Elm, Idris, Blockchains, AI, Universal Income…
good food
Summary
● Why Elm?
● What’s Elm?
● TEA (The Elm Architecture)
● Elm vs ScalaJS
● Elm in Scala Projects
Why Elm?
Created by Evan Czaplicki in 2012
“If typed functional programming is so great,
how come nobody uses it?” Let's be
mainstream!
How it feels to learn JavaScript in 2016
Objective: NO RUNTIME ERRORS!
What’s Elm?
● Simple language
○ Statically typed, strict, purely functional
○ Compiles to JavaScript
● Simple framework / libraries
○ TEA (The Elm Architecture)
○ Use “Obvious names” No M-word
● Simple and user focused tools
○ Friendly compiler error messages
○ Time travel debugger, elm-format…
○ Automatic semver enforcement with elm-package
Values - Literals
Values - Lists & Tuples
● Lists: All 4 are equivalent below
● Tuples
Since 0.18
Values - Union Types
Values - Records
Functions
What else?
● If and let expressions
● No for or while loops
● Operators
● JavaScript interop with ports
● Modules
For more Elm syntax
That’s it?!
● No type classes
● No higher kinded types (ex: Functor[F[_]])
○ First order kinds like Monoids supported only
Feel frustrated? Try PureScript
TEA - The Elm Architecture
Simple and amazingly scalable pattern
(overly simplified view below)
Model or State
record type
(managed)
View
(managed by
elm-html)
elm-html
runtime
view()
function
Messages
union type
update()
function
*code you need to write in blue
TEA - Model
TEA - Update
TEA - View
TEA - Main
Since 0.18
Performance
Benchmark: Adding 100 items in the TodoMVC app
Ecosystem
● Write HTML with elm-html
● Write CSS with elm-css
● Material Design with elm-mdl
● Make HTTP calls with elm-http
● Unit testing with elm-test
● …
Guess the pattern? More Awesome Elm
Learn More
● http://elm-lang.org/
● Elm Slack
● http://exercism.io/languages/elm
● Elm Weekly Newsletter
● On Twitter
○ @elmlang
○ @czaplic
○ @rtfeldman
○ @elmcastio
○ @elmstuff
Elm vs ScalaJS
ScalaJS Elm
Opinionated No Highly
JS Interoperability Easy Hard (discouraged)
SPA Framework scalajs-react, udash.io elm-html (TEA)
Runtime Size 100KB 10KB
Build Tool SBT elm-package
Semantic Versioning No Yes
IDE Support Excellent in Intellij Excellent in Atom
Debugger Standard IDE tools Time-travel debugger
Ecosystem Huge Small but growing fast
Elm in Scala Projects
SBT Elm plugin
Check out examples folder
Elm records generated from Scala case classes with
scala-elm-types
Show time!

More Related Content

What's hot

F# type providers
F# type providersF# type providers
F# type providersAntya Dev
 
A sip of elixir
A sip of elixirA sip of elixir
A sip of elixirUttam Kini
 
Typescript in 30mins
Typescript in 30mins Typescript in 30mins
Typescript in 30mins Udaya Kumar
 
Java Training In Ahmedabad
Java Training In AhmedabadJava Training In Ahmedabad
Java Training In AhmedabadRiya Shah
 
JavaScript (without DOM)
JavaScript (without DOM)JavaScript (without DOM)
JavaScript (without DOM)Piyush Katariya
 
Trends in programming languages
Trends in programming languagesTrends in programming languages
Trends in programming languagesAntya Dev
 

What's hot (6)

F# type providers
F# type providersF# type providers
F# type providers
 
A sip of elixir
A sip of elixirA sip of elixir
A sip of elixir
 
Typescript in 30mins
Typescript in 30mins Typescript in 30mins
Typescript in 30mins
 
Java Training In Ahmedabad
Java Training In AhmedabadJava Training In Ahmedabad
Java Training In Ahmedabad
 
JavaScript (without DOM)
JavaScript (without DOM)JavaScript (without DOM)
JavaScript (without DOM)
 
Trends in programming languages
Trends in programming languagesTrends in programming languages
Trends in programming languages
 

Similar to Play with elm - Choucri fahed, Finstack - Lambadays

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
 
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
 
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with ThymeleafSpring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with ThymeleafThymeleaf
 
Elm & Elixir: Functional Programming and Web
Elm & Elixir: Functional Programming and WebElm & Elixir: Functional Programming and Web
Elm & Elixir: Functional Programming and WebPublitory
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScriptJorg Janke
 
Why Functional Programming and Clojure - LightningTalk
Why Functional Programming and Clojure - LightningTalkWhy Functional Programming and Clojure - LightningTalk
Why Functional Programming and Clojure - LightningTalkJakub Holy
 
HelsinkiJS - Clojurescript for Javascript Developers
HelsinkiJS - Clojurescript for Javascript DevelopersHelsinkiJS - Clojurescript for Javascript Developers
HelsinkiJS - Clojurescript for Javascript DevelopersJuho Teperi
 
Software Craftmanship - Cours Polytech
Software Craftmanship - Cours PolytechSoftware Craftmanship - Cours Polytech
Software Craftmanship - Cours Polytechyannick grenzinger
 
elm-presentation.pptx
elm-presentation.pptxelm-presentation.pptx
elm-presentation.pptxABDBenali
 
Power Leveling your TypeScript
Power Leveling your TypeScriptPower Leveling your TypeScript
Power Leveling your TypeScriptOffirmo
 
Introduction to f#
Introduction to f#Introduction to f#
Introduction to f#mjyeaney
 
Dart the better Javascript 2015
Dart the better Javascript 2015Dart the better Javascript 2015
Dart the better Javascript 2015Jorg Janke
 
Elm or how I learned to love front-end development
Elm or how I learned to love front-end developmentElm or how I learned to love front-end development
Elm or how I learned to love front-end developmentCodemotion
 
Powering Tensorflow with big data using Apache Beam, Flink, and Spark - OSCON...
Powering Tensorflow with big data using Apache Beam, Flink, and Spark - OSCON...Powering Tensorflow with big data using Apache Beam, Flink, and Spark - OSCON...
Powering Tensorflow with big data using Apache Beam, Flink, and Spark - OSCON...Holden Karau
 
Performance optimization techniques for Java code
Performance optimization techniques for Java codePerformance optimization techniques for Java code
Performance optimization techniques for Java codeAttila Balazs
 
Simplifying training deep and serving learning models with big data in python...
Simplifying training deep and serving learning models with big data in python...Simplifying training deep and serving learning models with big data in python...
Simplifying training deep and serving learning models with big data in python...Holden Karau
 

Similar to Play with elm - Choucri fahed, Finstack - Lambadays (20)

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...
 
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...
 
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with ThymeleafSpring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
 
Elm & Elixir: Functional Programming and Web
Elm & Elixir: Functional Programming and WebElm & Elixir: Functional Programming and Web
Elm & Elixir: Functional Programming and Web
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScript
 
Why Functional Programming and Clojure - LightningTalk
Why Functional Programming and Clojure - LightningTalkWhy Functional Programming and Clojure - LightningTalk
Why Functional Programming and Clojure - LightningTalk
 
HelsinkiJS - Clojurescript for Javascript Developers
HelsinkiJS - Clojurescript for Javascript DevelopersHelsinkiJS - Clojurescript for Javascript Developers
HelsinkiJS - Clojurescript for Javascript Developers
 
Software Craftmanship - Cours Polytech
Software Craftmanship - Cours PolytechSoftware Craftmanship - Cours Polytech
Software Craftmanship - Cours Polytech
 
Thinking Functionally
Thinking FunctionallyThinking Functionally
Thinking Functionally
 
elm-presentation.pptx
elm-presentation.pptxelm-presentation.pptx
elm-presentation.pptx
 
Power Leveling your TypeScript
Power Leveling your TypeScriptPower Leveling your TypeScript
Power Leveling your TypeScript
 
Introduction to f#
Introduction to f#Introduction to f#
Introduction to f#
 
Dart the better Javascript 2015
Dart the better Javascript 2015Dart the better Javascript 2015
Dart the better Javascript 2015
 
Elm or how I learned to love front-end development
Elm or how I learned to love front-end developmentElm or how I learned to love front-end development
Elm or how I learned to love front-end development
 
Powering Tensorflow with big data using Apache Beam, Flink, and Spark - OSCON...
Powering Tensorflow with big data using Apache Beam, Flink, and Spark - OSCON...Powering Tensorflow with big data using Apache Beam, Flink, and Spark - OSCON...
Powering Tensorflow with big data using Apache Beam, Flink, and Spark - OSCON...
 
Performance optimization techniques for Java code
Performance optimization techniques for Java codePerformance optimization techniques for Java code
Performance optimization techniques for Java code
 
EduSymp 2022 slides (The Epsilon Playground)
EduSymp 2022 slides (The Epsilon Playground)EduSymp 2022 slides (The Epsilon Playground)
EduSymp 2022 slides (The Epsilon Playground)
 
Erlang, an overview
Erlang, an overviewErlang, an overview
Erlang, an overview
 
Simplifying training deep and serving learning models with big data in python...
Simplifying training deep and serving learning models with big data in python...Simplifying training deep and serving learning models with big data in python...
Simplifying training deep and serving learning models with big data in python...
 
The Skinny on Slim
The Skinny on SlimThe Skinny on Slim
The Skinny on Slim
 

Recently uploaded

Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Recently uploaded (20)

Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

Play with elm - Choucri fahed, Finstack - Lambadays

  • 1. Play with Elm! Rethink Web Development
  • 2. About Me Choucri FAHED CTO of Finstack Scala, FP, Elm, Idris, Blockchains, AI, Universal Income… good food
  • 3. Summary ● Why Elm? ● What’s Elm? ● TEA (The Elm Architecture) ● Elm vs ScalaJS ● Elm in Scala Projects
  • 4. Why Elm? Created by Evan Czaplicki in 2012 “If typed functional programming is so great, how come nobody uses it?” Let's be mainstream! How it feels to learn JavaScript in 2016 Objective: NO RUNTIME ERRORS!
  • 5. What’s Elm? ● Simple language ○ Statically typed, strict, purely functional ○ Compiles to JavaScript ● Simple framework / libraries ○ TEA (The Elm Architecture) ○ Use “Obvious names” No M-word ● Simple and user focused tools ○ Friendly compiler error messages ○ Time travel debugger, elm-format… ○ Automatic semver enforcement with elm-package
  • 7. Values - Lists & Tuples ● Lists: All 4 are equivalent below ● Tuples Since 0.18
  • 11. What else? ● If and let expressions ● No for or while loops ● Operators ● JavaScript interop with ports ● Modules For more Elm syntax
  • 12. That’s it?! ● No type classes ● No higher kinded types (ex: Functor[F[_]]) ○ First order kinds like Monoids supported only Feel frustrated? Try PureScript
  • 13. TEA - The Elm Architecture Simple and amazingly scalable pattern (overly simplified view below) Model or State record type (managed) View (managed by elm-html) elm-html runtime view() function Messages union type update() function *code you need to write in blue
  • 18. Performance Benchmark: Adding 100 items in the TodoMVC app
  • 19. Ecosystem ● Write HTML with elm-html ● Write CSS with elm-css ● Material Design with elm-mdl ● Make HTTP calls with elm-http ● Unit testing with elm-test ● … Guess the pattern? More Awesome Elm
  • 20. Learn More ● http://elm-lang.org/ ● Elm Slack ● http://exercism.io/languages/elm ● Elm Weekly Newsletter ● On Twitter ○ @elmlang ○ @czaplic ○ @rtfeldman ○ @elmcastio ○ @elmstuff
  • 21. Elm vs ScalaJS ScalaJS Elm Opinionated No Highly JS Interoperability Easy Hard (discouraged) SPA Framework scalajs-react, udash.io elm-html (TEA) Runtime Size 100KB 10KB Build Tool SBT elm-package Semantic Versioning No Yes IDE Support Excellent in Intellij Excellent in Atom Debugger Standard IDE tools Time-travel debugger Ecosystem Huge Small but growing fast
  • 22. Elm in Scala Projects SBT Elm plugin Check out examples folder Elm records generated from Scala case classes with scala-elm-types Show time!