SlideShare a Scribd company logo
1 of 17
training@instil.co
September 2018
© Instil Software 2018
F# and Fable
Functional Client Side Development
Eamonn.Boyle@instil.co
@BoyleEamonn
F# and Fable
Functional Client Side Development
.NET strongly & statically typed multi-paradigm language
• Imperative
• Object Oriented
• Functional First
Open source, cross platform
• Mono, .NET Framework & .NET Core
Stable – currently on version 4.5 (August 2018)
• Version 1.0 released in 2005
• Passionate Community
A lot of nice C# features originated in F#
F#
Originally a .NET implementation of OCaml so the syntax is similar
Heavy use of type inference
• Expressions, function parameters and return types etc all inferred from usage
• Can reduce the amount of typing (pun intended)
• Can lead to very strange error messages
Focuses on pushing runtime errors to compile time
• Very strict type system
Easy interop with .NET (C#) libraries
F# Syntax
Type bindings and helpers for easy interop with JavaScript
• Including Type Safe helpers for React
Supports most of the F# core library
There’s a tool to convert TypeScript bindings to Fable bindings
• https://github.com/fable-compiler/ts2fable
Fable
Fable is an F# to JavaScript compiler powered by
Babel, designed to produce readable and standard
code.
Elm-like abstractions for F#
Facilitates creating Model-View-Update applications
• Similar to using Redux with something like React
• Does not include the View part, instead you use the Fable React helpers
The main building blocks are
• Model
• Messages
• Commands
• Initialisation
• Update
• Views
• Program
Elmish
© Instil Software 2018
Demo
© Instil Software 2018
The Bad Stuff
“This was the hardest development
experience, period!!”
Type inference can be very confusing
• I enjoy type inference in C#, Kotlin etc
• This is at another level
• Inference in one part of the program can be dictated by usage far away
• This can lead to confusing error messages
• Explicit types can help here
• But then the syntax can be longer than other languages
File order matters – this caught me out a few times
Tooling is not perfect
• I found myself moving between VS Code and JetBrains Rider
Runtime errors can still occur and can be difficult to debug
• Some of the error messages are minimal
The Bad Stuff (very subjective)
I found the React bindings a pain compared to using HTML
• It’s better because it’s type safe but…
• Tooling around HTML + CSS is pretty mature while this isn’t
• More difficult if working with other tools, designers and existing skills
• I find standard JSX with React much easier
White space significance is a pain
I found it difficult to structure the app
• Some blocks of code were getting very large
• I would need to build much larger apps to see how this scales
The Bad Stuff (very subjective)
© Instil Software 2018
The Good Stuff
The language is pretty cool - succinct functional syntax
• Pipes
• Function Composition
• Type Definition and Domain Modeling
• Operator Overloading
• etc
Strict Type System
• Catches a lot of errors
• Exhaustive pattern matching
• Units of measure
• Etc
Easy interop and drop down to OO or imperative style if required
The Good Stuff
This ability to use OO & imperative is essential when targeting JavaScript platform
• Good bindings to access dynamic types
Tooling is very good
• Very quick to create a project from templates
• Visual Studio Code + Ionide is pretty good and is completely free
• HTML to Elmish converter - https://mangelmaxime.github.io/html-to-elmish/
• Hot Module Reloading while retaining state
Elmish MVU pattern is very good and is well implemented
• Very succinct to build up types, state and views
The Good Stuff
© Instil Software 2018
Conclusion
It is very impressive what these projects have accomplished
Some aspects of the development are succinct, safe and neat
If you are a functional fan & especially if doing F#, then this is pretty awesome
My Conclusion
But…
For my money, TypeScript is a better solution
Better balance (compromise) on safety, succinctness & productivity
• Gives me type safety (even if less expressive)
• Much easier interop with JavaScript (it’s a superset)
• Easier consumption of existing JavaScript libraries
• Better tooling
I would stick with standard HTML/JSX for my view definitions
• Not because it is necessarily better for defining views
• Simply because the tooling, documentation and onboarding is easier
Angular has excellent TypeScript APIs
My Conclusion

More Related Content

What's hot

Tech breakfast 18
Tech breakfast 18Tech breakfast 18
Tech breakfast 18James Leone
 
Tweakers Developers Summit 2019 - Angular for backend developers
Tweakers Developers Summit 2019 - Angular for backend developersTweakers Developers Summit 2019 - Angular for backend developers
Tweakers Developers Summit 2019 - Angular for backend developersBert Jan Schrijver
 
Learning Usage of English KWICly with WebLEAP/DSR
Learning Usage of English KWICly with WebLEAP/DSRLearning Usage of English KWICly with WebLEAP/DSR
Learning Usage of English KWICly with WebLEAP/DSRTakashi Yamanoue
 
Cross platform development
Cross platform developmentCross platform development
Cross platform developmentEvolve
 
OpenValue meetup July 2018 - Angular for Java developers
OpenValue meetup July 2018 - Angular for Java developersOpenValue meetup July 2018 - Angular for Java developers
OpenValue meetup July 2018 - Angular for Java developersBert Jan Schrijver
 
Code Nomads meetup June 2018 - Angular for Java developers
Code Nomads meetup June 2018 - Angular for Java developersCode Nomads meetup June 2018 - Angular for Java developers
Code Nomads meetup June 2018 - Angular for Java developersBert Jan Schrijver
 
J-Spring 2018 - Angular for Java developers
J-Spring 2018 - Angular for Java developersJ-Spring 2018 - Angular for Java developers
J-Spring 2018 - Angular for Java developersBert Jan Schrijver
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Hannes Lowette
 
Facilitating Idiomatic Swift with Objective-C
Facilitating Idiomatic Swift with Objective-CFacilitating Idiomatic Swift with Objective-C
Facilitating Idiomatic Swift with Objective-CAaron Taylor
 
Accelerating Angular Application Development with Third Party Code
Accelerating Angular Application Development with Third Party CodeAccelerating Angular Application Development with Third Party Code
Accelerating Angular Application Development with Third Party CodeMatt Eland
 
Best Practices in Software Development
Best Practices in Software DevelopmentBest Practices in Software Development
Best Practices in Software DevelopmentAndré Pitombeira
 
A sip of elixir
A sip of elixirA sip of elixir
A sip of elixirUttam Kini
 
Python debuggers slides
Python debuggers slidesPython debuggers slides
Python debuggers slidesmattboehm
 
Swift: The Basics
Swift: The BasicsSwift: The Basics
Swift: The BasicsMarc Brown
 
Basic introduction to python
Basic introduction to pythonBasic introduction to python
Basic introduction to pythonpoonam bora
 
Coding Standard And Code Review
Coding Standard And Code ReviewCoding Standard And Code Review
Coding Standard And Code ReviewMilan Vukoje
 
Extending Machine Translation in AEM
Extending Machine Translation in AEMExtending Machine Translation in AEM
Extending Machine Translation in AEMVivek Sachdeva
 
Becoming fully buzzword compliant
Becoming fully buzzword compliantBecoming fully buzzword compliant
Becoming fully buzzword compliantTrisha Gee
 
10/29 Austin Ansible MeetUp - AnsibleFest Talk & Extending Ansible
10/29 Austin Ansible MeetUp - AnsibleFest Talk & Extending Ansible10/29 Austin Ansible MeetUp - AnsibleFest Talk & Extending Ansible
10/29 Austin Ansible MeetUp - AnsibleFest Talk & Extending Ansibletylerturk
 

What's hot (20)

Tech breakfast 18
Tech breakfast 18Tech breakfast 18
Tech breakfast 18
 
Tweakers Developers Summit 2019 - Angular for backend developers
Tweakers Developers Summit 2019 - Angular for backend developersTweakers Developers Summit 2019 - Angular for backend developers
Tweakers Developers Summit 2019 - Angular for backend developers
 
Learning Usage of English KWICly with WebLEAP/DSR
Learning Usage of English KWICly with WebLEAP/DSRLearning Usage of English KWICly with WebLEAP/DSR
Learning Usage of English KWICly with WebLEAP/DSR
 
Cross platform development
Cross platform developmentCross platform development
Cross platform development
 
OpenValue meetup July 2018 - Angular for Java developers
OpenValue meetup July 2018 - Angular for Java developersOpenValue meetup July 2018 - Angular for Java developers
OpenValue meetup July 2018 - Angular for Java developers
 
Code Nomads meetup June 2018 - Angular for Java developers
Code Nomads meetup June 2018 - Angular for Java developersCode Nomads meetup June 2018 - Angular for Java developers
Code Nomads meetup June 2018 - Angular for Java developers
 
J-Spring 2018 - Angular for Java developers
J-Spring 2018 - Angular for Java developersJ-Spring 2018 - Angular for Java developers
J-Spring 2018 - Angular for Java developers
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®
 
Facilitating Idiomatic Swift with Objective-C
Facilitating Idiomatic Swift with Objective-CFacilitating Idiomatic Swift with Objective-C
Facilitating Idiomatic Swift with Objective-C
 
Accelerating Angular Application Development with Third Party Code
Accelerating Angular Application Development with Third Party CodeAccelerating Angular Application Development with Third Party Code
Accelerating Angular Application Development with Third Party Code
 
Best Practices in Software Development
Best Practices in Software DevelopmentBest Practices in Software Development
Best Practices in Software Development
 
A sip of elixir
A sip of elixirA sip of elixir
A sip of elixir
 
Python debuggers slides
Python debuggers slidesPython debuggers slides
Python debuggers slides
 
Swift: The Basics
Swift: The BasicsSwift: The Basics
Swift: The Basics
 
Basic introduction to python
Basic introduction to pythonBasic introduction to python
Basic introduction to python
 
Polyglot
PolyglotPolyglot
Polyglot
 
Coding Standard And Code Review
Coding Standard And Code ReviewCoding Standard And Code Review
Coding Standard And Code Review
 
Extending Machine Translation in AEM
Extending Machine Translation in AEMExtending Machine Translation in AEM
Extending Machine Translation in AEM
 
Becoming fully buzzword compliant
Becoming fully buzzword compliantBecoming fully buzzword compliant
Becoming fully buzzword compliant
 
10/29 Austin Ansible MeetUp - AnsibleFest Talk & Extending Ansible
10/29 Austin Ansible MeetUp - AnsibleFest Talk & Extending Ansible10/29 Austin Ansible MeetUp - AnsibleFest Talk & Extending Ansible
10/29 Austin Ansible MeetUp - AnsibleFest Talk & Extending Ansible
 

Similar to 2018-09 - F# and Fable

Down With JavaScript!
Down With JavaScript!Down With JavaScript!
Down With JavaScript!Garth Gilmour
 
NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET Dmytro Mindra
 
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
 
Extreme Programming (XP): Revisted
Extreme Programming (XP): RevistedExtreme Programming (XP): Revisted
Extreme Programming (XP): RevistedMike Harris
 
10 Big Ideas from Industry
10 Big Ideas from Industry10 Big Ideas from Industry
10 Big Ideas from IndustryGarth Gilmour
 
It's XP Stupid (2019)
It's XP Stupid (2019)It's XP Stupid (2019)
It's XP Stupid (2019)Mike Harris
 
An Introduction To Software Development - Implementation
An Introduction To Software Development - ImplementationAn Introduction To Software Development - Implementation
An Introduction To Software Development - ImplementationBlue Elephant Consulting
 
Programming using C++ - slides.pptx
Programming using C++ - slides.pptxProgramming using C++ - slides.pptx
Programming using C++ - slides.pptxHeadoftheDepartment
 
The Psychology of C# Analysis
The Psychology of C# AnalysisThe Psychology of C# Analysis
The Psychology of C# AnalysisCoverity
 
Creating a compiler for your own language
Creating a compiler for your own languageCreating a compiler for your own language
Creating a compiler for your own languageAndrea Tino
 
The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.6 book - Part 6 of 189The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.6 book - Part 6 of 189Mahmoud Samir Fayed
 
Putting Compilers to Work
Putting Compilers to WorkPutting Compilers to Work
Putting Compilers to WorkSingleStore
 
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Molieremfrancis
 
10 Reasons You MUST Consider Pattern-Aware Programming
10 Reasons You MUST Consider Pattern-Aware Programming10 Reasons You MUST Consider Pattern-Aware Programming
10 Reasons You MUST Consider Pattern-Aware ProgrammingPostSharp Technologies
 
From hello world to goodbye code
From hello world to goodbye codeFrom hello world to goodbye code
From hello world to goodbye codeKim Moir
 

Similar to 2018-09 - F# and Fable (20)

Down With JavaScript!
Down With JavaScript!Down With JavaScript!
Down With JavaScript!
 
NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET
 
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
 
CPP03 - Repetition
CPP03 - RepetitionCPP03 - Repetition
CPP03 - Repetition
 
Extreme Programming (XP): Revisted
Extreme Programming (XP): RevistedExtreme Programming (XP): Revisted
Extreme Programming (XP): Revisted
 
Intro To AOP
Intro To AOPIntro To AOP
Intro To AOP
 
10 Big Ideas from Industry
10 Big Ideas from Industry10 Big Ideas from Industry
10 Big Ideas from Industry
 
Vba Class Level 3
Vba Class Level 3Vba Class Level 3
Vba Class Level 3
 
It's XP Stupid (2019)
It's XP Stupid (2019)It's XP Stupid (2019)
It's XP Stupid (2019)
 
An Introduction To Software Development - Implementation
An Introduction To Software Development - ImplementationAn Introduction To Software Development - Implementation
An Introduction To Software Development - Implementation
 
Programming using C++ - slides.pptx
Programming using C++ - slides.pptxProgramming using C++ - slides.pptx
Programming using C++ - slides.pptx
 
The Psychology of C# Analysis
The Psychology of C# AnalysisThe Psychology of C# Analysis
The Psychology of C# Analysis
 
Creating a compiler for your own language
Creating a compiler for your own languageCreating a compiler for your own language
Creating a compiler for your own language
 
The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.6 book - Part 6 of 189The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.6 book - Part 6 of 189
 
Putting Compilers to Work
Putting Compilers to WorkPutting Compilers to Work
Putting Compilers to Work
 
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
10 clues showing that you are doing OSGi in the wrong manner - Jerome Moliere
 
C c#
C c#C c#
C c#
 
10 Reasons You MUST Consider Pattern-Aware Programming
10 Reasons You MUST Consider Pattern-Aware Programming10 Reasons You MUST Consider Pattern-Aware Programming
10 Reasons You MUST Consider Pattern-Aware Programming
 
From hello world to goodbye code
From hello world to goodbye codeFrom hello world to goodbye code
From hello world to goodbye code
 

More from Eamonn Boyle

Kotlin for Android - Goto Copenhagan 2019
Kotlin for Android - Goto Copenhagan 2019Kotlin for Android - Goto Copenhagan 2019
Kotlin for Android - Goto Copenhagan 2019Eamonn Boyle
 
Kotlin Native - C / Swift Interop - ACCU Autmn 2019
Kotlin Native - C / Swift Interop - ACCU Autmn 2019Kotlin Native - C / Swift Interop - ACCU Autmn 2019
Kotlin Native - C / Swift Interop - ACCU Autmn 2019Eamonn Boyle
 
2019-06 - Goto Amsterdam - Microservices
2019-06 - Goto Amsterdam - Microservices2019-06 - Goto Amsterdam - Microservices
2019-06 - Goto Amsterdam - MicroservicesEamonn Boyle
 
2019-01-29 - Demystifying Kotlin Coroutines
2019-01-29 - Demystifying Kotlin Coroutines2019-01-29 - Demystifying Kotlin Coroutines
2019-01-29 - Demystifying Kotlin CoroutinesEamonn Boyle
 
Kotlin for all the Things
Kotlin for all the ThingsKotlin for all the Things
Kotlin for all the ThingsEamonn Boyle
 
BelTech 2017 - Building Quality in the Browser
BelTech 2017 - Building Quality in the BrowserBelTech 2017 - Building Quality in the Browser
BelTech 2017 - Building Quality in the BrowserEamonn Boyle
 
ASP .Net Core SPA Templates
ASP .Net Core SPA TemplatesASP .Net Core SPA Templates
ASP .Net Core SPA TemplatesEamonn Boyle
 
Being Expressive in Code
Being Expressive in CodeBeing Expressive in Code
Being Expressive in CodeEamonn Boyle
 

More from Eamonn Boyle (8)

Kotlin for Android - Goto Copenhagan 2019
Kotlin for Android - Goto Copenhagan 2019Kotlin for Android - Goto Copenhagan 2019
Kotlin for Android - Goto Copenhagan 2019
 
Kotlin Native - C / Swift Interop - ACCU Autmn 2019
Kotlin Native - C / Swift Interop - ACCU Autmn 2019Kotlin Native - C / Swift Interop - ACCU Autmn 2019
Kotlin Native - C / Swift Interop - ACCU Autmn 2019
 
2019-06 - Goto Amsterdam - Microservices
2019-06 - Goto Amsterdam - Microservices2019-06 - Goto Amsterdam - Microservices
2019-06 - Goto Amsterdam - Microservices
 
2019-01-29 - Demystifying Kotlin Coroutines
2019-01-29 - Demystifying Kotlin Coroutines2019-01-29 - Demystifying Kotlin Coroutines
2019-01-29 - Demystifying Kotlin Coroutines
 
Kotlin for all the Things
Kotlin for all the ThingsKotlin for all the Things
Kotlin for all the Things
 
BelTech 2017 - Building Quality in the Browser
BelTech 2017 - Building Quality in the BrowserBelTech 2017 - Building Quality in the Browser
BelTech 2017 - Building Quality in the Browser
 
ASP .Net Core SPA Templates
ASP .Net Core SPA TemplatesASP .Net Core SPA Templates
ASP .Net Core SPA Templates
 
Being Expressive in Code
Being Expressive in CodeBeing Expressive in Code
Being Expressive in Code
 

Recently uploaded

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
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
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
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina 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
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 

Recently uploaded (20)

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...
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
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...
 
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...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
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...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 

2018-09 - F# and Fable

  • 1. training@instil.co September 2018 © Instil Software 2018 F# and Fable Functional Client Side Development Eamonn.Boyle@instil.co @BoyleEamonn
  • 2. F# and Fable Functional Client Side Development
  • 3. .NET strongly & statically typed multi-paradigm language • Imperative • Object Oriented • Functional First Open source, cross platform • Mono, .NET Framework & .NET Core Stable – currently on version 4.5 (August 2018) • Version 1.0 released in 2005 • Passionate Community A lot of nice C# features originated in F# F#
  • 4. Originally a .NET implementation of OCaml so the syntax is similar Heavy use of type inference • Expressions, function parameters and return types etc all inferred from usage • Can reduce the amount of typing (pun intended) • Can lead to very strange error messages Focuses on pushing runtime errors to compile time • Very strict type system Easy interop with .NET (C#) libraries F# Syntax
  • 5. Type bindings and helpers for easy interop with JavaScript • Including Type Safe helpers for React Supports most of the F# core library There’s a tool to convert TypeScript bindings to Fable bindings • https://github.com/fable-compiler/ts2fable Fable Fable is an F# to JavaScript compiler powered by Babel, designed to produce readable and standard code.
  • 6. Elm-like abstractions for F# Facilitates creating Model-View-Update applications • Similar to using Redux with something like React • Does not include the View part, instead you use the Fable React helpers The main building blocks are • Model • Messages • Commands • Initialisation • Update • Views • Program Elmish
  • 7. © Instil Software 2018 Demo
  • 8. © Instil Software 2018 The Bad Stuff
  • 9. “This was the hardest development experience, period!!”
  • 10. Type inference can be very confusing • I enjoy type inference in C#, Kotlin etc • This is at another level • Inference in one part of the program can be dictated by usage far away • This can lead to confusing error messages • Explicit types can help here • But then the syntax can be longer than other languages File order matters – this caught me out a few times Tooling is not perfect • I found myself moving between VS Code and JetBrains Rider Runtime errors can still occur and can be difficult to debug • Some of the error messages are minimal The Bad Stuff (very subjective)
  • 11. I found the React bindings a pain compared to using HTML • It’s better because it’s type safe but… • Tooling around HTML + CSS is pretty mature while this isn’t • More difficult if working with other tools, designers and existing skills • I find standard JSX with React much easier White space significance is a pain I found it difficult to structure the app • Some blocks of code were getting very large • I would need to build much larger apps to see how this scales The Bad Stuff (very subjective)
  • 12. © Instil Software 2018 The Good Stuff
  • 13. The language is pretty cool - succinct functional syntax • Pipes • Function Composition • Type Definition and Domain Modeling • Operator Overloading • etc Strict Type System • Catches a lot of errors • Exhaustive pattern matching • Units of measure • Etc Easy interop and drop down to OO or imperative style if required The Good Stuff
  • 14. This ability to use OO & imperative is essential when targeting JavaScript platform • Good bindings to access dynamic types Tooling is very good • Very quick to create a project from templates • Visual Studio Code + Ionide is pretty good and is completely free • HTML to Elmish converter - https://mangelmaxime.github.io/html-to-elmish/ • Hot Module Reloading while retaining state Elmish MVU pattern is very good and is well implemented • Very succinct to build up types, state and views The Good Stuff
  • 15. © Instil Software 2018 Conclusion
  • 16. It is very impressive what these projects have accomplished Some aspects of the development are succinct, safe and neat If you are a functional fan & especially if doing F#, then this is pretty awesome My Conclusion But…
  • 17. For my money, TypeScript is a better solution Better balance (compromise) on safety, succinctness & productivity • Gives me type safety (even if less expressive) • Much easier interop with JavaScript (it’s a superset) • Easier consumption of existing JavaScript libraries • Better tooling I would stick with standard HTML/JSX for my view definitions • Not because it is necessarily better for defining views • Simply because the tooling, documentation and onboarding is easier Angular has excellent TypeScript APIs My Conclusion