SlideShare a Scribd company logo
Elm
Never get a runtime error anymore. Almost.
Montage
Secret techniques for reliable projects
• Use pure functions
• Avoid nulls
• Immutability everywhere
• Powerful type system
• One global state
• View is just a pure function of state
Elm
Has Haskell-like syntax, but thankfully it’s not Haskell
Elm
• Pure language
• No nulls
• Everything is immutable
• Compiler checks everything
• Very opinionated
Elm Architecture
View
function
Model
data
Update
Action
function
Event
Handlerevent
event
Elm Architecture is a fractal
Event
Handlerevent
event
Model
UpdateView
Model
UpdateView
Model
UpdateView
ModelUpdate
View
Action
No, not really…
Cons
• Very opinionated
• Tooling
• Dead Code Elimination
• Immaturity
• Runtime errors are still possible
• Some things are hard to do
• Almost no libraries for “production”
• Poor coverage of modern browser APIs
Is it ready for production?
It depends…
But if you learn it,
it will make you a better JavaScript developer.

More Related Content

What's hot

SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...
SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...
SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...
Sébastien Levert
 
Capistrano @ VilniusPHP
Capistrano @ VilniusPHPCapistrano @ VilniusPHP
Capistrano @ VilniusPHP
Vidmantas Kabošis
 
DevOps Cardiff - Puppet vs Chef vs Ansible
DevOps Cardiff - Puppet vs Chef vs AnsibleDevOps Cardiff - Puppet vs Chef vs Ansible
DevOps Cardiff - Puppet vs Chef vs Ansible
Mark Phillips
 
Flask and Paramiko for Python VA
Flask and Paramiko for Python VAFlask and Paramiko for Python VA
Flask and Paramiko for Python VA
Enrique Valenzuela
 
"GitHub com for lazy in cloud project management" by Sergejs Matancevs from S...
"GitHub com for lazy in cloud project management" by Sergejs Matancevs from S..."GitHub com for lazy in cloud project management" by Sergejs Matancevs from S...
"GitHub com for lazy in cloud project management" by Sergejs Matancevs from S...
DevClub_lv
 
Promise of a better future by Rahul Goma Phulore and Pooja Akshantal, Thought...
Promise of a better future by Rahul Goma Phulore and Pooja Akshantal, Thought...Promise of a better future by Rahul Goma Phulore and Pooja Akshantal, Thought...
Promise of a better future by Rahul Goma Phulore and Pooja Akshantal, Thought...
Thoughtworks
 
Spotify's Music Recommendations Lambda Architecture
Spotify's Music Recommendations Lambda ArchitectureSpotify's Music Recommendations Lambda Architecture
Spotify's Music Recommendations Lambda Architecture
Esh Vckay
 
Entity framework advanced
Entity framework advancedEntity framework advanced
Entity framework advanced
Usama Nada
 
Serverless microservices in the wild
Serverless microservices in the wildServerless microservices in the wild
Serverless microservices in the wild
Rotem Tamir
 
Alexandra johnson reducing operational barriers to model training
Alexandra johnson   reducing operational barriers to model trainingAlexandra johnson   reducing operational barriers to model training
Alexandra johnson reducing operational barriers to model training
MLconf
 
Go with the flow!
Go with the flow!Go with the flow!
Go with the flow!
Jaap Brasser
 
Elm & Elixir: Functional Programming and Web
Elm & Elixir: Functional Programming and WebElm & Elixir: Functional Programming and Web
Elm & Elixir: Functional Programming and Web
Publitory
 
Autopilot, but never let go of the wheel
Autopilot, but never let go of the wheelAutopilot, but never let go of the wheel
Autopilot, but never let go of the wheel
Simon McCartney
 
PuppetConf 2017: No Server Left Behind - Miguel Di Ciurcio Filho, Instruct
PuppetConf 2017: No Server Left Behind - Miguel Di Ciurcio Filho, InstructPuppetConf 2017: No Server Left Behind - Miguel Di Ciurcio Filho, Instruct
PuppetConf 2017: No Server Left Behind - Miguel Di Ciurcio Filho, Instruct
Puppet
 
North American Collaboration Summit 2018 - SharePoint Framework, Angular & Az...
North American Collaboration Summit 2018 - SharePoint Framework, Angular & Az...North American Collaboration Summit 2018 - SharePoint Framework, Angular & Az...
North American Collaboration Summit 2018 - SharePoint Framework, Angular & Az...
Sébastien Levert
 
SharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure FunctionsSharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure Functions
Sébastien Levert
 
Devops With Boxfuse and Shippable
Devops With Boxfuse and ShippableDevops With Boxfuse and Shippable
Devops With Boxfuse and Shippable
Andrew Schwabe
 
Automate yourself out of a job - Use ChatOps!
Automate yourself out of a job - Use ChatOps!Automate yourself out of a job - Use ChatOps!
Automate yourself out of a job - Use ChatOps!
Jaap Brasser
 
Episode 19 - Asynchronous Apex - Batch apex & schedulers
Episode 19 - Asynchronous Apex - Batch apex & schedulersEpisode 19 - Asynchronous Apex - Batch apex & schedulers
Episode 19 - Asynchronous Apex - Batch apex & schedulers
Jitendra Zaa
 
Playing nice with the MEAN stack
Playing nice with the MEAN stackPlaying nice with the MEAN stack
Playing nice with the MEAN stack
Aspenware
 

What's hot (20)

SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...
SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...
SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...
 
Capistrano @ VilniusPHP
Capistrano @ VilniusPHPCapistrano @ VilniusPHP
Capistrano @ VilniusPHP
 
DevOps Cardiff - Puppet vs Chef vs Ansible
DevOps Cardiff - Puppet vs Chef vs AnsibleDevOps Cardiff - Puppet vs Chef vs Ansible
DevOps Cardiff - Puppet vs Chef vs Ansible
 
Flask and Paramiko for Python VA
Flask and Paramiko for Python VAFlask and Paramiko for Python VA
Flask and Paramiko for Python VA
 
"GitHub com for lazy in cloud project management" by Sergejs Matancevs from S...
"GitHub com for lazy in cloud project management" by Sergejs Matancevs from S..."GitHub com for lazy in cloud project management" by Sergejs Matancevs from S...
"GitHub com for lazy in cloud project management" by Sergejs Matancevs from S...
 
Promise of a better future by Rahul Goma Phulore and Pooja Akshantal, Thought...
Promise of a better future by Rahul Goma Phulore and Pooja Akshantal, Thought...Promise of a better future by Rahul Goma Phulore and Pooja Akshantal, Thought...
Promise of a better future by Rahul Goma Phulore and Pooja Akshantal, Thought...
 
Spotify's Music Recommendations Lambda Architecture
Spotify's Music Recommendations Lambda ArchitectureSpotify's Music Recommendations Lambda Architecture
Spotify's Music Recommendations Lambda Architecture
 
Entity framework advanced
Entity framework advancedEntity framework advanced
Entity framework advanced
 
Serverless microservices in the wild
Serverless microservices in the wildServerless microservices in the wild
Serverless microservices in the wild
 
Alexandra johnson reducing operational barriers to model training
Alexandra johnson   reducing operational barriers to model trainingAlexandra johnson   reducing operational barriers to model training
Alexandra johnson reducing operational barriers to model training
 
Go with the flow!
Go with the flow!Go with the flow!
Go with the flow!
 
Elm & Elixir: Functional Programming and Web
Elm & Elixir: Functional Programming and WebElm & Elixir: Functional Programming and Web
Elm & Elixir: Functional Programming and Web
 
Autopilot, but never let go of the wheel
Autopilot, but never let go of the wheelAutopilot, but never let go of the wheel
Autopilot, but never let go of the wheel
 
PuppetConf 2017: No Server Left Behind - Miguel Di Ciurcio Filho, Instruct
PuppetConf 2017: No Server Left Behind - Miguel Di Ciurcio Filho, InstructPuppetConf 2017: No Server Left Behind - Miguel Di Ciurcio Filho, Instruct
PuppetConf 2017: No Server Left Behind - Miguel Di Ciurcio Filho, Instruct
 
North American Collaboration Summit 2018 - SharePoint Framework, Angular & Az...
North American Collaboration Summit 2018 - SharePoint Framework, Angular & Az...North American Collaboration Summit 2018 - SharePoint Framework, Angular & Az...
North American Collaboration Summit 2018 - SharePoint Framework, Angular & Az...
 
SharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure FunctionsSharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure Functions
 
Devops With Boxfuse and Shippable
Devops With Boxfuse and ShippableDevops With Boxfuse and Shippable
Devops With Boxfuse and Shippable
 
Automate yourself out of a job - Use ChatOps!
Automate yourself out of a job - Use ChatOps!Automate yourself out of a job - Use ChatOps!
Automate yourself out of a job - Use ChatOps!
 
Episode 19 - Asynchronous Apex - Batch apex & schedulers
Episode 19 - Asynchronous Apex - Batch apex & schedulersEpisode 19 - Asynchronous Apex - Batch apex & schedulers
Episode 19 - Asynchronous Apex - Batch apex & schedulers
 
Playing nice with the MEAN stack
Playing nice with the MEAN stackPlaying nice with the MEAN stack
Playing nice with the MEAN stack
 

Similar to Elm - never get a runtime error anymore. Almost.

The Architect Way
The Architect WayThe Architect Way
The Architect Way
Jan Jongboom
 
Introduction to Aspect Oriented Programming by Donald Belcham
Introduction to Aspect Oriented Programming by Donald BelchamIntroduction to Aspect Oriented Programming by Donald Belcham
Introduction to Aspect Oriented Programming by Donald Belcham
.NET Conf UY
 
Introduction To AOP
Introduction To AOPIntroduction To AOP
Introduction To AOP
Donald Belcham
 
Phoenix for Rubyists
Phoenix for RubyistsPhoenix for Rubyists
Phoenix for Rubyists
Doug Goldie
 
Hot to build continuously processing for 24/7 real-time data streaming platform?
Hot to build continuously processing for 24/7 real-time data streaming platform?Hot to build continuously processing for 24/7 real-time data streaming platform?
Hot to build continuously processing for 24/7 real-time data streaming platform?
GetInData
 
Intro to elixir and phoenix
Intro to elixir and phoenixIntro to elixir and phoenix
Intro to elixir and phoenix
Jared Smith
 
Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016
Charles Nutter
 
Scala Days Chicago 2017: Building a Company on Scala
Scala Days Chicago 2017: Building a Company on ScalaScala Days Chicago 2017: Building a Company on Scala
Scala Days Chicago 2017: Building a Company on Scala
Natalie Vegel
 
Generalization in Auto-Testing. How we put what we had into new Technological...
Generalization in Auto-Testing. How we put what we had into new Technological...Generalization in Auto-Testing. How we put what we had into new Technological...
Generalization in Auto-Testing. How we put what we had into new Technological...
SQALab
 
EclipseCon Europe 2011
EclipseCon Europe 2011EclipseCon Europe 2011
EclipseCon Europe 2011
Sigasi
 
What is Elm and Why Should I Care?
What is Elm and Why Should I Care?What is Elm and Why Should I Care?
What is Elm and Why Should I Care?
Claudio D'Alicandro
 
Erlang, the big switch in social games
Erlang, the big switch in social gamesErlang, the big switch in social games
Erlang, the big switch in social games
Wooga
 
Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"
Paolo Negri
 
DevOps 201607
DevOps 201607 DevOps 201607
DevOps 201607
Vishwanath Ramdas
 
Enterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScriptEnterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScript
Troy Miles
 
Perl in Teh Cloud
Perl in Teh CloudPerl in Teh Cloud
Perl in Teh Cloud
Pedro Figueiredo
 
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdf
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdfWessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdf
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdf
Wessel Loth
 
Typesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and PlayTypesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and Play
Luka Zakrajšek
 
The ABC's of IaC
The ABC's of IaCThe ABC's of IaC
The ABC's of IaC
Steven Pressman, CISSP
 
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In ActionKotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
Marko Mitic
 

Similar to Elm - never get a runtime error anymore. Almost. (20)

The Architect Way
The Architect WayThe Architect Way
The Architect Way
 
Introduction to Aspect Oriented Programming by Donald Belcham
Introduction to Aspect Oriented Programming by Donald BelchamIntroduction to Aspect Oriented Programming by Donald Belcham
Introduction to Aspect Oriented Programming by Donald Belcham
 
Introduction To AOP
Introduction To AOPIntroduction To AOP
Introduction To AOP
 
Phoenix for Rubyists
Phoenix for RubyistsPhoenix for Rubyists
Phoenix for Rubyists
 
Hot to build continuously processing for 24/7 real-time data streaming platform?
Hot to build continuously processing for 24/7 real-time data streaming platform?Hot to build continuously processing for 24/7 real-time data streaming platform?
Hot to build continuously processing for 24/7 real-time data streaming platform?
 
Intro to elixir and phoenix
Intro to elixir and phoenixIntro to elixir and phoenix
Intro to elixir and phoenix
 
Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016
 
Scala Days Chicago 2017: Building a Company on Scala
Scala Days Chicago 2017: Building a Company on ScalaScala Days Chicago 2017: Building a Company on Scala
Scala Days Chicago 2017: Building a Company on Scala
 
Generalization in Auto-Testing. How we put what we had into new Technological...
Generalization in Auto-Testing. How we put what we had into new Technological...Generalization in Auto-Testing. How we put what we had into new Technological...
Generalization in Auto-Testing. How we put what we had into new Technological...
 
EclipseCon Europe 2011
EclipseCon Europe 2011EclipseCon Europe 2011
EclipseCon Europe 2011
 
What is Elm and Why Should I Care?
What is Elm and Why Should I Care?What is Elm and Why Should I Care?
What is Elm and Why Should I Care?
 
Erlang, the big switch in social games
Erlang, the big switch in social gamesErlang, the big switch in social games
Erlang, the big switch in social games
 
Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"
 
DevOps 201607
DevOps 201607 DevOps 201607
DevOps 201607
 
Enterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScriptEnterprise Strength Mobile JavaScript
Enterprise Strength Mobile JavaScript
 
Perl in Teh Cloud
Perl in Teh CloudPerl in Teh Cloud
Perl in Teh Cloud
 
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdf
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdfWessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdf
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdf
 
Typesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and PlayTypesafe stack - Scala, Akka and Play
Typesafe stack - Scala, Akka and Play
 
The ABC's of IaC
The ABC's of IaCThe ABC's of IaC
The ABC's of IaC
 
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In ActionKotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
 

Recently uploaded

Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
Severalnines
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
Maitrey Patel
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
Karya Keeper
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Paul Brebner
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Peter Caitens
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
Tier1 app
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
kalichargn70th171
 
Quarter 3 SLRP grade 9.. gshajsbhhaheabh
Quarter 3 SLRP grade 9.. gshajsbhhaheabhQuarter 3 SLRP grade 9.. gshajsbhhaheabh
Quarter 3 SLRP grade 9.. gshajsbhhaheabh
aisafed42
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
The Third Creative Media
 

Recently uploaded (20)

Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
 
Quarter 3 SLRP grade 9.. gshajsbhhaheabh
Quarter 3 SLRP grade 9.. gshajsbhhaheabhQuarter 3 SLRP grade 9.. gshajsbhhaheabh
Quarter 3 SLRP grade 9.. gshajsbhhaheabh
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
 

Elm - never get a runtime error anymore. Almost.

Editor's Notes

  1. Hi! My name is Anton, and I gonna tell you about the Elm language. There are tons of compiled-to-JS languages (https://github.com/jashkenas/coffeescript/wiki/list-of-languages-that-compile-to-js over 9000!), so, why would I want to tell you about Elm? Well, let me step back and tell you about my recent project I participated, Montage.
  2. This is basically a photobook editor. You upload a bunch of photos, zoom, pan, rearrange them, then click Order, and you'll receive a physical photo book in a week. It was a super fun project to work on. Also, it was technically a complex and big project. We wrote it in Dart, which is statically typed, and static typing helped a lot and eliminated a lot of bugs. We also added a powerful troubleshooting system to it - we log all user's actions starting from when they opened the editor, and every time runtime exception happens there, we send that exception to Rollbar (error aggregator service), and attach the logs of all the user actions (including HTTP requests and responses) to these exceptions, together with the user's account name. So whenever user complains something doesn't work there, we theoretically have a lot of information to help - we usually can see the exception, which just happened, all the history of user's actions, requests and responses from our servers, etc. And still, more often than not, I'm looking at all of this, and I have NO IDEA what just happened. How she ended up with that state of the app? How to help the user and at least make sure the project will be saved properly? Why the hell there's no method blah on null, since that thing just never should be null? Could we avoid all these problems and create a more reliable app, which would have less problems? Well, yeah, there're a lot of techniques, which help with that, like:
  3. * Use pure functions whenever it is possible, try to isolate side effects * Avoid nulls, there were tons of errors when we call something on null, it was like 80% of errors in out Rollbar. I wish it was easy in any language with nulls... * Enforce immutability. Immutable objects and values give you piece of mind nothing will ever change them, it's way easier to reason about them, and less chances to make a mistake when using them. * Use powerful type system, make the compiler check everything and catch errors for developers early, making it impossible to make runtime errors. All the errors should be caught in compile time. * Concentrate the state in one place, so we don't need to sync a lot of local states between each other Make rendering is just a pure function of the global state (like redux does currently), local states are very painful to sync. After Montage, I started to dream about some language or technology, which would solve all these problems we had with Montage, which wouldn't allow us to make runtime errors. Which would just force me to handle every case where something may go wrong, because by the Murphy's law things will go wrong if there's even a slight chance for that for some user.
  4. Elm is a small, simple, very opinionated, staticly typed, pure, functional reactive programming language. It has Haskell-inspired syntax, which is very concise and elegant, and the type system is also Haskell-inspired (with type inference, yay! So you don't have to write all these Foo foo = new Foo() all the time). It doesn't have nulls, it has union types, and overall the type system is quite flexible. Thankfully, it's not as flexible as in Haskell, and fear not, it's not as complex as Haskell, it's actually quite simple. Elm doesn't have typeclasses, monads, do notation, and all these crazy things like this one:
  5. * Elm is a pure language. You can only define pure functions there, no side effects (well, almost. E.g. you can write to console.log) But we need side effects and state, right? So, Elm solves it with FRP, i.e. it uses "signals" to route user events and other external events into the app, and respond to them. Just like in RxJavaScript, Bacon, etc. * No nulls. Ever. What to do if there's no value? You should use Maybe. But the difference is - if something returns Maybe, you HAVE TO handle both cases (when there is value and when there's no value). Otherwise, you'll get a compiler error. So, no chance of runtime error here. * Everything is immutable. When you need to change a list or a record, you create a new one. It's not as inefficient as you'd think, because it uses special data structures under the hood to make it fast. * Compiler checks everything, there's literally almost no chance to get a runtime error. It will check that you handled every possible case in your 'switch' statements, that everything type checks, that you handled all possible errors you can get from HTTP requests, that you handled possible wrong JSON responses from the server, etc. Some prolific Elm developers stated they never have seen a runtime error in their Elm apps in their code, all runtime errors are coming from the JS code. Elm is very opinionated about the architecture of your app, if you don't follow what they recommend, you gonna struggle. It's basically a single global state of the app + Command-Query pattern + view as a pure function. The good thing - it's a good architecture, from my experience (and I built 2 apps on that architecture already) - it simplifies the app significantly, and makes debugging very simple. And simple debugging is prob the biggest takeaways after Montage - if you are building a big app, you should really build mechanisms for debugging it, because you’ll need it a lot, and your app will fail in different and totally random places. I keep talking about how it’s opinionated and about Elm architecture, but what it is, really? Let’s see:
  6. We don't live in the world of ponies and butterflies. Using every technology or language is a tradeoff, and Elm is not an exception. Everything has pluses and minuses. I really don't like when you listen to a talk about some technology or language, and you only get ponies, but not scary dragons. But dragons are there, for sure. So, for Elm, the minuses would be:
  7. * It's very opinionated. If you don't like that "Elm architecture", you are pretty much doomed. It's almost impossible to use another architecture to write a web app in Elm. On the other hand, if you like it and follow the architecture, everything in the language is built with the assumption you are going to use it. * Tooling. There's a package manager, some integrations with editors, but no IDE features - i.e. no go to definition, no find usages, no refactorings, global renamings, check inferred type under cursor, etc. Coming from the Dart world, where the tools are top-notch and state of art, this looks really poor. * No tree shaking. The output of the code is not Google Closure compatible, you cannot use it to eliminate unused code (e.g. in ClojureScript or Dart you can). So, the compiled JS size could be smaller. * Immaturity. Despite the community is growing, it's still prob < 1% of the JS community. Not many packages, no millions of answers on Stack Overflow, sometimes documentation is sparse. Of course you can use JS packages, there's JS interop in place, but dealing with JS you're losing all this safety and 'no runtime errors' features. * Runtime errors are still possible (though very rare). E.g. if you call Debug.crash explicitly, or try to create incorrect regex. Even worse, sometimes you can make it compile, you won't have a runtime error, but then it silently doesn't work. E.g. if you forgot to wire a port, or used a decoder on an event, and that decoder is not compatible with the event's JSON (looking for a nonexisting field, for example). In this case you'll click to a button, and nothing gonna happen. It also is quite rare, but still possible, and this sucks. * Some simple operations are actually a big deal and require a lot of ceremony. For example, getting height of a generic DOM node is quite tricky to do, you'll have to do that either via ports, (basically, send a request to JS side, and then wait for a response. There's no guarantee JS won't throw an exception on its side). Or you can do that via so-called Native Elm - i.e. write an extension in JS, which will be mapped to Elm's function. Native Elm is how all the core library is implemented. But again, you'll have to be super careful there, things could go even worse, e.g. if you return a null, and Elm's function should return Int, you'll eventually get a runtime error somewhere INSIDE Elm code once it tries to apply e.g. multiplication or another int-specific funciton. * No production libraries. Like, gathering all the runtime errors and sending them to Rollbar, sending metrics to GA or Mixpanel, logging packages, etc. Things, which are must for production-ready apps. * A lot of browser APIs are not covered by Elm's standard lib. No File API, no Service Workers, etc. You can do them via ports (JS intro), but again - you will work in JS unsafe realm. Evan (the creator of the language) promises a lot of improvements in this field in the next version of the language though. In your real app you gonna use ports a lot - even getting a width of a DOM element is not a pure function, so you have to do that via ports, getting a signal of it. Still, I think this is a very interesting and promising language. It allows you to build very robust and easy to understand core, and move all the impurity and unsafety out of it to JS side, which is very useful for mid-large size projects. I think it's a very promising technology.
  8. Is it ready for production? Well, it depends… And this is probably not the answer you want to hear from me, so I’ll try to elaborate. If you build a next-gen main application for your company, and it gonna take 60 developer months and you bet all your money on it, then I wouldn’t take Elm. I’d probably take TypeScript. Since you have to have the talent pool of developers to hire, Stack Overflow answers for most problems which can arise, solid IDE and plenty of packages to use. Ironically, Elm is supposed to be used in large projects like this, but IMHO a bit too early for it. Some mid size non-central internal tool - I think a good candidate to try it out. Small front-end projects - doesn’t really matter what language to use, IMHO, as long as you can keep the whole app in your head. But if you’re building large JS projects, want to build large JS projects, want to know more how to build mid-to-large JS projects, you should really look into Elm. It will show you how to work in a pure language, how you can manage state and side effects in front-end projects, how you can build apps using Elm architecture, which is a very elegant architecture. It’s also a quite gentle introduction into functional programming, without head-cracking concepts like in Haskell. So, I encourage you to try it out, it will make you a better JavaScript developer after all. That’s it, thank you!