SlideShare a Scribd company logo
| Basel
The F# Path to Relaxation
Language Design, Platforms, Community, Openness
Don Syme, F# Community Contributor, MSR Principal Researcher in
Mobile Tools
The F# Path to Relaxation
The F# Path to Relaxation
The F# Path to Relaxation
The F# Path to Relaxation
X Y
Functional Interop
The F# Path to Relaxation
The F# Path to Relaxation
✔
✔
✔
✖
Functional Interop
X Y
Enterprise Openness
F# is open, cross-
platform, neutral,
independent
All F# language and
tooling is accepting
contributions
The F# community is
very “self-empowered”
fsharp.org
Xamarin provide F#
tools Android and iOS
The Visual F# Tools are
Microsoft’s
professional tools for
Windows and Azure
Debian, RPM and .NET
Core for Linux/OSX
The F# Compiler
Service powers many
other tools
Fable for F#-to-
Javascript
SAFE for F# fullstack
F# 4.1 now complete!
The F# Path to Relaxation
fsharp.github.io
github.com/fsharp/fslang-design
github.com/fsharp/fslang-suggestions
✔
✔
✔
✔
✔
✔
https://github.com/fsharp/fslang-design/tree/master/FSharp-4.0
✔
✔
✔
✔
✔
✔
https://github.com/fsharp/fslang-design/tree/master/FSharp-4.1
The F# Path to Relaxation
docs.microsoft.com/en-us/dotnet/core/
fable.io
fsharp.github.io/FSharp.Compiler.Service
The F# Path to Relaxation
printfn "hello world"
✓
✓
✓
✓
✓
✓
The F# Path to Relaxation
let symbolUses =
symbolUses
|> Array.filter (fun symbolUse -> …)
|> Array.Parallel.map (fun symbolUse -> …)
|> Array.filter (fun … -> …)
|> Array.groupBy (fun … -> …)
|> Array.map (fun … ->….)
The F# Path to Relaxation
https://lukemerrett.com/fsharp-domain-modelling/
type Status =
| Online
| Unresponsive of string
| Missing of string
| NotChecked of string
| Ignored
https://medium.com/@odytrice Ody Mbegbu
type Value =
| Integer of int64
| String of string
| Date of DateTime
| Data of string
| Bool of bool
| Dict of (string * Value) list
| Array of Value list
The F# Path to Relaxation
The F# Path to Relaxation
/// The view function giving updated content for the page
let view model dispatch =
match model.Text with
| [| |] ->
div [] [ div [] [str "Loading..."] ]
| _ ->
div [ ClassName "container" ] [
button [ OnClick (fun _ -> dispatch Faster) ] [ str "Faster" ]
div [ ClassName "theText" ] [ str model.Text.[model.Index] ]
button [ OnClick (fun _ -> dispatch Slower) ] [ str "Slower" ]
div [] [ str (sprintf "Ticks Per Update: %d" model.TicksPerUpdate) ]
]
A functional-reactive
dynamic web view
/// The view function giving updated content for the page
let view (model: Model) dispatch =
if model.Pressed then
Xaml.Label(text="I was pressed!")
else
Xaml.Button(text="Press Me!", command=(fun () -> dispatch Pressed))
A functional-reactive mobile
app view
type Msg = | Pressed
type Model = { Pressed: bool }
let init() = { Pressed=false }
let update msg model =
match msg with
| Pressed -> { model with Pressed = true }
let view (model: Model) dispatch =
if model.Pressed then
Xaml.abel(text="I was pressed!")
else
Xaml.Button(text="Press Me!", command=(fun () -> dispatch Pressed))
type App () =
inherit Application ()
do Program.run init update view
A full Xamarin mobile app
The messages
The initial model
The update function
The dynamic view
Host+run
github.com/fsprojects/Elmish.XamarinForms/
The model
The F# Path to Relaxation
✔
Enterprise Openness
X Y
Functional Objects
The F# Path to Relaxation
type Vector2D (dx:double, dy:double) =
let d2 = dx*dx+dy*dy
member v.DX = dx
member v.DY = dy
member v.Length = sqrt d2
member v.Scale(k) = Vector2D (dx*k, dy*k)
Inputs to object
construction
Exported properties
Exported method
Object internals
Object Interface Types
type IObject =
interface ISimpleObject
abstract Prop1 : type
abstract Meth2 : type -> type
Object Expressions
{ new IObject with
member x.Prop1 = expr
member x.Meth1 args = expr }
{ new Object() with
member x.Prop1 = expr
interface IObject with
member x.Meth1 args = expr
interface IWidget with
member x.Meth1 args = expr }
Constructed Class Types
type ObjectType(args) =
let internalValue = expr
let internalFunction args = expr
let mutable internalState = expr
member x.Prop1 = expr
member x.Meth2 args = expr
The F# Path to Relaxation
The F# Path to Relaxation
objects as a single paradigm
overuse of hierarchical classification
large abstractions many holes failure points
declarations expressions
complex inheriting complex
The F# Path to Relaxation
✔
Functional Objects
fsharp.org/testimonials
350,000
lines of C# OO
by offshore team
30,000
lines of robust F#, with
parallel +more features
An application to evaluate the revenue due from Balancing Services contracts in
the UK energy industry
http://simontcousins.azurewebsites.net/does-the-language-you-use-make-a-
difference-revisited/
The F# Path to Relaxation
The F# Path to Relaxation
Zero
bugs in deployed system
“F# is the safe choice for this project,
any other choice is too risky”
An application to evaluate the revenue due from Balancing Services contracts in the
UK energy industry
http://simontcousins.azurewebsites.net/does-the-language-you-use-make-a-
difference-revisited/
The F# Path to Relaxation
X Y
Pattern
Matching
Abstraction
The F# Path to Relaxation
The F# Path to Relaxation
The F# Path to Relaxation
The F# Path to Relaxation
module BasicPatterns =
let (|Value|_|) (e:FSharpExpr) = ...
let (|Const|_|) (e:FSharpExpr) = ...
let (|TypeLambda|_|) (e:FSharpExpr) = ...
let (|Lambda|_|) (e:FSharpExpr) = ...
let (|Application|_|) (e:FSharpExpr) = ...
let (|IfThenElse|_|) (e:FSharpExpr) = ...
let (|Let|_|) (e:FSharpExpr) = ...
let (|LetRec|_|) (e:FSharpExpr) = ...
let (|NewRecord|_|) (e:FSharpExpr) = ...
let (|NewUnionCase|_|) (e:FSharpExpr) = ...
let (|NewTuple|_|) (e:FSharpExpr) = ...
let (|TupleGet|_|) (e:FSharpExpr) = ...
let (|IdentifierNameSyntax|_|) (n: CSharpSyntaxNode) =
match n with
| :? IdentifierNameSyntax as t -> Some(t.CSharpKind(), t.Identifier)
| _ -> None
let (|IdentifierName|_|) (n: CSharpSyntaxNode) =
match n.CSharpKind() with
| SyntaxKind.IdentifierName -> ...
| _ -> None
let (|QualifiedNameSyntax|_|) (n: CSharpSyntaxNode) =
match n with
| :? QualifiedNameSyntax as t -> ...
| _ -> None
let (|QualifiedName|_|) (n: CSharpSyntaxNode) =
match n.CSharpKind() with
| SyntaxKind.QualifiedName -> ...
| _ -> None
✔
Pattern
Matching
Abstraction
Code Data
The F# Path to Relaxation
1 2 3 4 5 6 7
2012 2013
6,432 10,537
The F# Path to Relaxation
Statically
Typed
Dynamically
Typed
Options
• make statically typed langs more
dynamic
• make dynamically typed langs more
static
• apply moderated static typing much
more broadly
The F# Path to Relaxation
http://fsharp.github.io/FSharp.Data/images/csv.gif
http://fsharp.github.io/FSharp.Data/images/wb.gif
types
Segoe UI Light
01/06/2018 70
01/06/2018 71
01/06/2018 72
01/06/2018 73
01/06/2018 74
01/06/2018 75
01/06/2018 76
01/06/2018 77
01/06/2018 78
01/06/2018 79
integrating internet-scale information services
directly into the program's variable and type space is
probably the most innovative programming language
idea I’ve heard of in a decade
✔ ✔
Code Data
X Y
Sync Async
Numbers
Numbers-
with Units
The F# Path to Relaxation
Synthesis from
contradiction is at
the heart of applied
PL design
Opposites come in
all shapes and
flavours
Achieve relaxation
today ☺
Code Data
Functi
onal
Objec
ts
Open
Enter
prise
Sync Async
… …
Thank you!!
Questions?

More Related Content

PPTX
Domain Modeling & Full-Stack Web Development F#
PPTX
"The F# Path to Relaxation", Don Syme
PPTX
F# for functional enthusiasts
PPTX
London F-Sharp User Group : Don Syme on F# - 09/09/2010
PPTX
Introduction to F#
PPTX
TechDaysNL 2015 - F# for C# Developers
ODP
Progressive f# tutorials nyc don syme on keynote f# in the open source world
PDF
Using F# to change the way we work
Domain Modeling & Full-Stack Web Development F#
"The F# Path to Relaxation", Don Syme
F# for functional enthusiasts
London F-Sharp User Group : Don Syme on F# - 09/09/2010
Introduction to F#
TechDaysNL 2015 - F# for C# Developers
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Using F# to change the way we work

Similar to The F# Path to Relaxation (20)

PPTX
iOS App Development with F# and Xamarin
PPTX
Developing mobile apps with f sharp
PDF
vpTech - Practical F# in Finance
PDF
"Introduction to F#" - South Dakota Code Camp, November 5, 2011
PPTX
Succeeding with Functional-first Programming in Enterprise
PPT
F# Sample and Resources
PDF
Madrid F# Meetup: Introduction to F#
PPTX
F# for BLOBA, by brandon d'imperio
PPTX
F# for C# devs - Leeds Sharp 2015
PPT
Bay NET Aug 19 2009 presentation ppt
PPTX
F# Tutorial @ QCon
PPTX
Mobile F#un
PPTX
Mini .net conf 2020
PPTX
F# for C# devs - SDD 2015
PDF
Lublin Startup Festival - Mobile Architecture Design Patterns
PPTX
F# for startups
PPTX
Exploring SharePoint with F#
PPTX
Xamarin tools
PPTX
F# for C# devs - Copenhagen .Net 2015
PDF
Functional programming with F#
iOS App Development with F# and Xamarin
Developing mobile apps with f sharp
vpTech - Practical F# in Finance
"Introduction to F#" - South Dakota Code Camp, November 5, 2011
Succeeding with Functional-first Programming in Enterprise
F# Sample and Resources
Madrid F# Meetup: Introduction to F#
F# for BLOBA, by brandon d'imperio
F# for C# devs - Leeds Sharp 2015
Bay NET Aug 19 2009 presentation ppt
F# Tutorial @ QCon
Mobile F#un
Mini .net conf 2020
F# for C# devs - SDD 2015
Lublin Startup Festival - Mobile Architecture Design Patterns
F# for startups
Exploring SharePoint with F#
Xamarin tools
F# for C# devs - Copenhagen .Net 2015
Functional programming with F#
Ad

More from J On The Beach (20)

PDF
Massively scalable ETL in real world applications: the hard way
PPTX
Big Data On Data You Don’t Have
PPTX
Acoustic Time Series in Industry 4.0: Improved Reliability and Cyber-Security...
PDF
Pushing it to the edge in IoT
PDF
Drinking from the firehose, with virtual streams and virtual actors
PDF
How do we deploy? From Punched cards to Immutable server pattern
PDF
Java, Turbocharged
PDF
When Cloud Native meets the Financial Sector
PDF
The big data Universe. Literally.
PDF
Streaming to a New Jakarta EE
PDF
The TIPPSS Imperative for IoT - Ensuring Trust, Identity, Privacy, Protection...
PDF
Pushing AI to the Client with WebAssembly and Blazor
PDF
Axon Server went RAFTing
PDF
The Six Pitfalls of building a Microservices Architecture (and how to avoid t...
PDF
Madaari : Ordering For The Monkeys
PDF
Servers are doomed to fail
PDF
Interaction Protocols: It's all about good manners
PDF
A race of two compilers: GraalVM JIT versus HotSpot JIT C2. Which one offers ...
PDF
Leadership at every level
PDF
Machine Learning: The Bare Math Behind Libraries
Massively scalable ETL in real world applications: the hard way
Big Data On Data You Don’t Have
Acoustic Time Series in Industry 4.0: Improved Reliability and Cyber-Security...
Pushing it to the edge in IoT
Drinking from the firehose, with virtual streams and virtual actors
How do we deploy? From Punched cards to Immutable server pattern
Java, Turbocharged
When Cloud Native meets the Financial Sector
The big data Universe. Literally.
Streaming to a New Jakarta EE
The TIPPSS Imperative for IoT - Ensuring Trust, Identity, Privacy, Protection...
Pushing AI to the Client with WebAssembly and Blazor
Axon Server went RAFTing
The Six Pitfalls of building a Microservices Architecture (and how to avoid t...
Madaari : Ordering For The Monkeys
Servers are doomed to fail
Interaction Protocols: It's all about good manners
A race of two compilers: GraalVM JIT versus HotSpot JIT C2. Which one offers ...
Leadership at every level
Machine Learning: The Bare Math Behind Libraries
Ad

Recently uploaded (20)

DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Electronic commerce courselecture one. Pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Machine learning based COVID-19 study performance prediction
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Big Data Technologies - Introduction.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Encapsulation theory and applications.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
The AUB Centre for AI in Media Proposal.docx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Diabetes mellitus diagnosis method based random forest with bat algorithm
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Electronic commerce courselecture one. Pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Network Security Unit 5.pdf for BCA BBA.
Unlocking AI with Model Context Protocol (MCP)
Machine learning based COVID-19 study performance prediction
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Big Data Technologies - Introduction.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Encapsulation theory and applications.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Per capita expenditure prediction using model stacking based on satellite ima...
NewMind AI Weekly Chronicles - August'25 Week I
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx

The F# Path to Relaxation