SlideShare a Scribd company logo
1 of 18
Download to read offline
Asynchronous programming on
 the server and the client in F#


          Tomas Petricek
          @tomaspetricek
In Visual Studio since 2010
Asynchronous programming

On the server side   On the client side
Demo: Social drawing app
Demo: Social drawing app




Server   Agents   Browser   Client
Async on the Server



Reactive programming without
   the inversion of control
Async on the Server

Reactive model is important
 Node.js and C# 5.0

F# asynchronous workflows
 Keep standard programming model
 Standard exception handling and loops
 Sequential and parallel composition
Agents and message-passing




Protected * ( Behaviour + State )
F# and the Browser

F# and Silverlight
  Both compiler and libraries
  Interactive Try F#

F# and JavaScript
  Translating since 2006!
  Open-source Pit, commercial WebSharper
Event handling in F#



Data flow using combinators
and control flow using async
Asynchronous GUI



User interactions = State machines
Asynchronous GUI

Updating rectangles   Drawing rectangles

                            waiting
      waiting
                       up             down


    after 500ms             drawing
Asynchronous GUI

Updating rectangles   Drawing rectangles

                            waiting
      waiting
                       up             down


    after 500ms             drawing

                            move
What else is there?
F# Interactive in your web browser
  www.tryfsharp.org

Type providers in F# 3.0
  Integrating data in the language

Bridges an important mismatch
  Data and services use REST, XML, …
  Languages use types and objects
Type providers
Where to learn more?

Functional and F# trainings
  http://functional-programming.net
  In London and New York

Functional Programming eXchange
  http://skillsmatter.com
  Next Friday (March 16th)
Summary

Asynchronous programming
  Writing non-blocking code
  Without the inversion of control

Application areas
  Server-side – reactive request processing
  Client-side – encoding state machines

More Related Content

Similar to Asynchronous programming in F# (QCon 2012)

App Engine overview (Android meetup 06-10)
App Engine overview (Android meetup 06-10)App Engine overview (Android meetup 06-10)
App Engine overview (Android meetup 06-10)
jasonacooper
 
Real time web applications with signal r
Real time web applications with signal rReal time web applications with signal r
Real time web applications with signal r
Elad Avneri
 
ITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep dive
ITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep diveITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep dive
ITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep dive
ITCamp
 

Similar to Asynchronous programming in F# (QCon 2012) (20)

Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy Mobile
 
Data-First Online Functional Programming with F# (Adam Granicz)
Data-First Online Functional Programming with F# (Adam Granicz)Data-First Online Functional Programming with F# (Adam Granicz)
Data-First Online Functional Programming with F# (Adam Granicz)
 
Domain Modeling & Full-Stack Web Development F#
Domain Modeling & Full-Stack Web Development F#Domain Modeling & Full-Stack Web Development F#
Domain Modeling & Full-Stack Web Development F#
 
Chapter13
Chapter13Chapter13
Chapter13
 
C# basics training (Interfaces)
C# basics training (Interfaces)C# basics training (Interfaces)
C# basics training (Interfaces)
 
hexMachina WWX 2016
hexMachina WWX 2016hexMachina WWX 2016
hexMachina WWX 2016
 
ch6. Introduction to programming languages.pptx
ch6. Introduction to programming languages.pptxch6. Introduction to programming languages.pptx
ch6. Introduction to programming languages.pptx
 
Serverless everywhere
Serverless everywhereServerless everywhere
Serverless everywhere
 
C# Cookware - presented at CukeUp! 2014
C# Cookware - presented at CukeUp! 2014C# Cookware - presented at CukeUp! 2014
C# Cookware - presented at CukeUp! 2014
 
App Engine overview (Android meetup 06-10)
App Engine overview (Android meetup 06-10)App Engine overview (Android meetup 06-10)
App Engine overview (Android meetup 06-10)
 
GraphQL: The Missing Link Between Frontend and Backend Devs
GraphQL: The Missing Link Between Frontend and Backend DevsGraphQL: The Missing Link Between Frontend and Backend Devs
GraphQL: The Missing Link Between Frontend and Backend Devs
 
Functional legacy - how to incorporate ZIO in your legacy services
Functional legacy - how to incorporate ZIO in your legacy servicesFunctional legacy - how to incorporate ZIO in your legacy services
Functional legacy - how to incorporate ZIO in your legacy services
 
Reactive APIs using Muon
Reactive APIs using MuonReactive APIs using Muon
Reactive APIs using Muon
 
Real time web applications with signal r
Real time web applications with signal rReal time web applications with signal r
Real time web applications with signal r
 
Eco system apps
Eco system appsEco system apps
Eco system apps
 
10 Key Criteria for Mobile Platform Selection
10 Key Criteria for Mobile Platform Selection10 Key Criteria for Mobile Platform Selection
10 Key Criteria for Mobile Platform Selection
 
Dubbo in Internet Finance Industry
Dubbo in Internet Finance IndustryDubbo in Internet Finance Industry
Dubbo in Internet Finance Industry
 
Reactive APIs using Muon
Reactive APIs using MuonReactive APIs using Muon
Reactive APIs using Muon
 
ITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep dive
ITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep diveITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep dive
ITCamp 2013 - Raffaele Rialdi - Windows Runtime (WinRT) deep dive
 
Introduction to ICS
Introduction to ICSIntroduction to ICS
Introduction to ICS
 

More from Tomas Petricek

Queries in general purpose languages
Queries in general purpose languagesQueries in general purpose languages
Queries in general purpose languages
Tomas Petricek
 

More from Tomas Petricek (18)

Coeffects: A Calculus of Context-Dependent Computation
Coeffects: A Calculus of Context-Dependent ComputationCoeffects: A Calculus of Context-Dependent Computation
Coeffects: A Calculus of Context-Dependent Computation
 
Domain Specific Languages: The Functional Way
Domain Specific Languages: The Functional WayDomain Specific Languages: The Functional Way
Domain Specific Languages: The Functional Way
 
F# Data: Making structured data first class citizens
F# Data: Making structured data first class citizensF# Data: Making structured data first class citizens
F# Data: Making structured data first class citizens
 
Doing data science with F# (BuildStuff)
Doing data science with F# (BuildStuff)Doing data science with F# (BuildStuff)
Doing data science with F# (BuildStuff)
 
Doing data science with F#
Doing data science with F#Doing data science with F#
Doing data science with F#
 
Creating Domain Specific Languages in F#
Creating Domain Specific Languages in F#Creating Domain Specific Languages in F#
Creating Domain Specific Languages in F#
 
How F# Learned to Stop Worrying and Love the Data
How F# Learned to Stop Worrying and Love the DataHow F# Learned to Stop Worrying and Love the Data
How F# Learned to Stop Worrying and Love the Data
 
Information-rich programming in F# (ML Workshop 2012)
Information-rich programming in F# (ML Workshop 2012)Information-rich programming in F# (ML Workshop 2012)
Information-rich programming in F# (ML Workshop 2012)
 
F# Type Providers in Depth
F# Type Providers in DepthF# Type Providers in Depth
F# Type Providers in Depth
 
Queries in general purpose languages
Queries in general purpose languagesQueries in general purpose languages
Queries in general purpose languages
 
Docase notation for Haskell
Docase notation for HaskellDocase notation for Haskell
Docase notation for Haskell
 
Accessing loosely structured data from F# and C#
Accessing loosely structured data from F# and C#Accessing loosely structured data from F# and C#
Accessing loosely structured data from F# and C#
 
F# on the Server-Side
F# on the Server-SideF# on the Server-Side
F# on the Server-Side
 
F# Tutorial @ QCon
F# Tutorial @ QConF# Tutorial @ QCon
F# Tutorial @ QCon
 
Teaching F#
Teaching F#Teaching F#
Teaching F#
 
F# in MonoDevelop
F# in MonoDevelopF# in MonoDevelop
F# in MonoDevelop
 
Academia
AcademiaAcademia
Academia
 
Concurrent programming with Agents
Concurrent programming with AgentsConcurrent programming with Agents
Concurrent programming with Agents
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

Asynchronous programming in F# (QCon 2012)