SlideShare a Scribd company logo
What is Elm and Why Should I Care?
Diving into some of the clever ideas of the Elm programming language
Ehm, ok… But who
the hell are you?!?
Claudio
D’Alicandro
Backend developer for
AdEspresso by Hootsuite
@_cdali
Why you should listen to me
● My Javascript Jutsu is bad, so sooo bad!
● In my backend career I wrote two lambda and three node services, at best
● I work mainly in PHP, you know... that language you think when you need to do
negative examples!
● In recent years I have worked hard in speaking about technologies with which I
have not made a penny
● The more I study, the more I give up my certainties about the world of
programming
Features
Yeah,
this is the “What is Elm” part…
elm
A delightful language for
reliable webapps.
Generate JavaScript with great performance and no
runtime exceptions.
No Runtime Exceptions
Characteristics
● Declarative web development
● Virtual DOM
As React also the Elm Runtime uses Virtual DOM for fast node updates
● Immutability
All values in Elm are immutable (Constants, Collections, ...)
● Purely functional
Javascript can have a functional style but it is not a functional language!
Elm is functional (Pure functions, currying by default, pattern matching ...)
● Static type checking
How does it works?
How does it works?
Elm Union Types
I call it my billion-dollar mistake… At that time, I was designing the first
comprehensive type system for references in an object-oriented language. My
goal was to ensure that all use of references should be absolutely safe, with
checking performed automatically by the compiler. But I couldn’t resist the
temptation to put in a null reference, simply because it was so easy to implement.
This has led to innumerable errors, vulnerabilities, and system crashes, which
have probably caused a billion dollars of pain and damage in the last forty years.
– Tony Hoare, inventor of ALGOL W.
How does it works?
How does it works?
Elm is a pure
functional language
100%Features that require side effects
Who will do the dirty work?
You will simply have to ask to the elm
runtime and it will do it for you!
How does it work?
I’m only describing how to generate a
random number and how to give it
back to me!
update
elm runtime
Random.generate produces a Cmd
msg, and sends it to the elm runtime…
Then the elm runtime generates a
random number for me, sends it back
to the update function in the way I
describe: as a NewFace Int
Cmd
Msg
Random.generate : (a -> msg) -> Random.Generator a -> Cmd msg
Elm Architecture
A comparison between redux
and elm architecture
Elm architecture vs Redux
Elm Runtime
Your code responsability: your code
elm runtime
Html
Msg
Sub
Cmd
● Produce HTML
● Emit Commands
● Establish Subscriptions
Elm Interop
Finally…
The “Why Should I Care” part!!
package.json
webpack.config.js
webpack.config.js
Hello from Elm!!
Hello from Elm!!
Hello from Elm… from React
Get fancier.... Flags and Ports
Get fancier.... Flags and Ports
Get fancier.... Flags and Ports
Get fancier.... Flags and Ports
Rewrite
Questions?

More Related Content

Similar to What is Elm and Why Should I Care?

Node.js meetup 17.05.2017 ember.js - escape the javascript fatigue
Node.js meetup 17.05.2017   ember.js - escape the javascript fatigueNode.js meetup 17.05.2017   ember.js - escape the javascript fatigue
Node.js meetup 17.05.2017 ember.js - escape the javascript fatigue
Tobias Braner
 
elm-presentation.pptx
elm-presentation.pptxelm-presentation.pptx
elm-presentation.pptx
ABDBenali
 
Boo Manifesto
Boo ManifestoBoo Manifesto
Boo Manifesto
hu hans
 
Your first Elm program
Your first Elm programYour first Elm program
Your first Elm program
Per Lundholm
 
Elm, the runtime error killer
Elm, the runtime error killerElm, the runtime error killer
Elm, the runtime error killer
Jordy Moos
 
Ajax Performance
Ajax PerformanceAjax Performance
Ajax Performance
kaven yan
 
Ob Essay
Ob EssayOb Essay
Ob Essay
Amanda Burkett
 
CC-Castle; The best Real-Time/Embedded/HighTech language EVER?
CC-Castle; The best Real-Time/Embedded/HighTech language EVER?CC-Castle; The best Real-Time/Embedded/HighTech language EVER?
CC-Castle; The best Real-Time/Embedded/HighTech language EVER?
Albert Mietus
 
PHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpPHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in php
Ahmed Abdou
 
My elixir helWo lorld
My elixir helWo lorldMy elixir helWo lorld
My elixir helWo lorld
Claudio D'Alicandro
 
Rethinking Best Practices
Rethinking Best PracticesRethinking Best Practices
Rethinking Best Practices
floydophone
 
An introduction to erlang
An introduction to erlangAn introduction to erlang
An introduction to erlang
Mirko Bonadei
 
ElixirConf 2017 - Writing an Editor in Elixir - Ian Duggan
ElixirConf 2017 - Writing an Editor in Elixir - Ian DugganElixirConf 2017 - Writing an Editor in Elixir - Ian Duggan
ElixirConf 2017 - Writing an Editor in Elixir - Ian Duggan
ijcd
 
Down With JavaScript!
Down With JavaScript!Down With JavaScript!
Down With JavaScript!
Garth Gilmour
 
What every C++ programmer should know about modern compilers (w/ comments, AC...
What every C++ programmer should know about modern compilers (w/ comments, AC...What every C++ programmer should know about modern compilers (w/ comments, AC...
What every C++ programmer should know about modern compilers (w/ comments, AC...
Sławomir Zborowski
 
Elm - never get a runtime error anymore. Almost.
Elm - never get a runtime error anymore. Almost.Elm - never get a runtime error anymore. Almost.
Elm - never get a runtime error anymore. Almost.
Anton Astashov
 
WebGL games with Minko - Next Game Frontier 2014
WebGL games with Minko - Next Game Frontier 2014WebGL games with Minko - Next Game Frontier 2014
WebGL games with Minko - Next Game Frontier 2014Minko3D
 
Remix Your Language Tooling (JSConf.eu 2012)
Remix Your Language Tooling (JSConf.eu 2012)Remix Your Language Tooling (JSConf.eu 2012)
Remix Your Language Tooling (JSConf.eu 2012)
lennartkats
 
IN4308 1
IN4308 1IN4308 1
IN4308 1
Eelco Visser
 
Survelaine murillo ppt
Survelaine murillo pptSurvelaine murillo ppt
Survelaine murillo ppt
Survelaine Murillo
 

Similar to What is Elm and Why Should I Care? (20)

Node.js meetup 17.05.2017 ember.js - escape the javascript fatigue
Node.js meetup 17.05.2017   ember.js - escape the javascript fatigueNode.js meetup 17.05.2017   ember.js - escape the javascript fatigue
Node.js meetup 17.05.2017 ember.js - escape the javascript fatigue
 
elm-presentation.pptx
elm-presentation.pptxelm-presentation.pptx
elm-presentation.pptx
 
Boo Manifesto
Boo ManifestoBoo Manifesto
Boo Manifesto
 
Your first Elm program
Your first Elm programYour first Elm program
Your first Elm program
 
Elm, the runtime error killer
Elm, the runtime error killerElm, the runtime error killer
Elm, the runtime error killer
 
Ajax Performance
Ajax PerformanceAjax Performance
Ajax Performance
 
Ob Essay
Ob EssayOb Essay
Ob Essay
 
CC-Castle; The best Real-Time/Embedded/HighTech language EVER?
CC-Castle; The best Real-Time/Embedded/HighTech language EVER?CC-Castle; The best Real-Time/Embedded/HighTech language EVER?
CC-Castle; The best Real-Time/Embedded/HighTech language EVER?
 
PHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in phpPHP Mega Meetup, Sep, 2020, Anti patterns in php
PHP Mega Meetup, Sep, 2020, Anti patterns in php
 
My elixir helWo lorld
My elixir helWo lorldMy elixir helWo lorld
My elixir helWo lorld
 
Rethinking Best Practices
Rethinking Best PracticesRethinking Best Practices
Rethinking Best Practices
 
An introduction to erlang
An introduction to erlangAn introduction to erlang
An introduction to erlang
 
ElixirConf 2017 - Writing an Editor in Elixir - Ian Duggan
ElixirConf 2017 - Writing an Editor in Elixir - Ian DugganElixirConf 2017 - Writing an Editor in Elixir - Ian Duggan
ElixirConf 2017 - Writing an Editor in Elixir - Ian Duggan
 
Down With JavaScript!
Down With JavaScript!Down With JavaScript!
Down With JavaScript!
 
What every C++ programmer should know about modern compilers (w/ comments, AC...
What every C++ programmer should know about modern compilers (w/ comments, AC...What every C++ programmer should know about modern compilers (w/ comments, AC...
What every C++ programmer should know about modern compilers (w/ comments, AC...
 
Elm - never get a runtime error anymore. Almost.
Elm - never get a runtime error anymore. Almost.Elm - never get a runtime error anymore. Almost.
Elm - never get a runtime error anymore. Almost.
 
WebGL games with Minko - Next Game Frontier 2014
WebGL games with Minko - Next Game Frontier 2014WebGL games with Minko - Next Game Frontier 2014
WebGL games with Minko - Next Game Frontier 2014
 
Remix Your Language Tooling (JSConf.eu 2012)
Remix Your Language Tooling (JSConf.eu 2012)Remix Your Language Tooling (JSConf.eu 2012)
Remix Your Language Tooling (JSConf.eu 2012)
 
IN4308 1
IN4308 1IN4308 1
IN4308 1
 
Survelaine murillo ppt
Survelaine murillo pptSurvelaine murillo ppt
Survelaine murillo ppt
 

Recently uploaded

Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
Kamal Acharya
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
Vaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdfVaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdf
Kamal Acharya
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
Kamal Acharya
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
abh.arya
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 

Recently uploaded (20)

Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
Vaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdfVaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdf
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 

What is Elm and Why Should I Care?

  • 1. What is Elm and Why Should I Care? Diving into some of the clever ideas of the Elm programming language
  • 2. Ehm, ok… But who the hell are you?!?
  • 4. Why you should listen to me ● My Javascript Jutsu is bad, so sooo bad! ● In my backend career I wrote two lambda and three node services, at best ● I work mainly in PHP, you know... that language you think when you need to do negative examples! ● In recent years I have worked hard in speaking about technologies with which I have not made a penny ● The more I study, the more I give up my certainties about the world of programming
  • 5.
  • 6. Features Yeah, this is the “What is Elm” part… elm A delightful language for reliable webapps. Generate JavaScript with great performance and no runtime exceptions.
  • 8. Characteristics ● Declarative web development ● Virtual DOM As React also the Elm Runtime uses Virtual DOM for fast node updates ● Immutability All values in Elm are immutable (Constants, Collections, ...) ● Purely functional Javascript can have a functional style but it is not a functional language! Elm is functional (Pure functions, currying by default, pattern matching ...) ● Static type checking
  • 9. How does it works?
  • 10. How does it works?
  • 11. Elm Union Types I call it my billion-dollar mistake… At that time, I was designing the first comprehensive type system for references in an object-oriented language. My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn’t resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years. – Tony Hoare, inventor of ALGOL W.
  • 12. How does it works?
  • 13. How does it works?
  • 14. Elm is a pure functional language
  • 16. Who will do the dirty work? You will simply have to ask to the elm runtime and it will do it for you!
  • 17. How does it work? I’m only describing how to generate a random number and how to give it back to me! update elm runtime Random.generate produces a Cmd msg, and sends it to the elm runtime… Then the elm runtime generates a random number for me, sends it back to the update function in the way I describe: as a NewFace Int Cmd Msg Random.generate : (a -> msg) -> Random.Generator a -> Cmd msg
  • 18. Elm Architecture A comparison between redux and elm architecture
  • 20. Elm Runtime Your code responsability: your code elm runtime Html Msg Sub Cmd ● Produce HTML ● Emit Commands ● Establish Subscriptions
  • 21. Elm Interop Finally… The “Why Should I Care” part!!
  • 27. Hello from Elm… from React