SlideShare une entreprise Scribd logo
1  sur  18
{
F#ture
and F#nctional Programming
Rodrigo Vidal
Twitter: @rodrigovidal
Blog: www.rodrigovidal.net
 Focus on Software Architecture
 F# and IronRuby/Ruby enthusiast.
 .NetArchitects – Rio de Janeiro , user group member
 Professional Scrum Developer
Quem sou eu?
 Old Paradigm
 52 years old
 Ignored by MainStream until now.
Functional Programming
 New Challenges
 Process big amount of data
 Escale to Clusters and Cores
Functional- Why now?
 Think out of the box
 Functional Programming is “safe”
 MultiCore and Cloud Computing applications
 Functional Programming is obtaning market
Why learn another language?
Imperative Vs. Declarative
What rather than How
Another way of thinking
List<string> res = new List<string>();
foreach(Product p in Products) {
if (p.UnitPrice > 75.0M) {
res.Add(String.Format("{0} - ${1}",
p.ProductName, p.UnitPrice));
}
}
var res = from p in Products
where p.UnitPrice > 75.0M
select string.Format("{0} - ${1}",
p.ProductName, p.UnitPrice);
return res;
Functional Paradigm
 Immutable Data
 Ability to compose functions
 Functions can be thread as data
 Lazy Evalution
 Pattern Matching
Immutability
“Values are immutable by default”
let x = 3
let x = 4
error FS0037: Duplicate definition of value ‘x'
Side-Effects
 A side effect
 Modifies some state
 Has observable interaction with calling functions
 Has observable interaction with the outside world
 Example: a function or method with no return value
let mutable x = 3
let y = x*3
x <- 4
let z = x*3
Composing Functions
f(x) = 3x+2
g(y) = 4y-1
Z = g(f(2)) = ?
f(x)
g(x)
let f x = 3*x + 2
let g y = (4*y) - 1
let z = g(f(2))
#Inception
Lambda
Calculus
LISP ML Ocaml Haskell F#
Languages Evolution
0
2
4
6
8
10
12
0 2 4 6 8 10 12
Usefulness
Safety
C#
Nirvana
Haskell
LINQ
C#, VB,
Java
LINQ Nirvana
Haskell
http://channel9.msdn.com/posts/Charles/Simon-Peyton-Jones-Towards-a-Programming-Language-Nirvana/
C#, VB, Java, C are
imperative
programming
languages. Very
useful but can change
the state of the world
at anytime creating
side effects.
Nirvana!
Useful and
Safe
Haskell is Very Safe, but
not very useful. Used
heavily in research and
academia, but rarely in
business.
F#
What´s is F#?
 Functional language developed by Microsoft Research
 By Don Syme and his team, who productized Generics
 Based on OCaml (influenced by C# and Haskell)
F# Evolution
2002
F# language
design started
2005 January
F# 1.0.1 releases
to public
2005 November
F# 1.1.5 with VS
2005 RTM support
2009 October
VS2010 Beta 2,
CTP for VS2008
& Non-
Windows users
2010
F# is
“productized”
and baked into
VS 2010
F# 2.0
Functional + Objects + .NET +
Async + Parallel + Interactive + Scripting
F# 2.0
//F#
open System
let a = 2
Console.WriteLine a
//C#
using System;
namespace ConsoleApplication1
{
class Program
{
static int a()
{
return 2;
}
static void Main(string[] args)
{
Console.WriteLine(a);
}
}
}
let fim = “Obrigado”

Contenu connexe

Tendances

The D Programming Language - Why I love it!
The D Programming Language - Why I love it!The D Programming Language - Why I love it!
The D Programming Language - Why I love it!
ryutenchi
 

Tendances (15)

[Question Paper] Object Oriented Programming With C++ (Revised Course) [June ...
[Question Paper] Object Oriented Programming With C++ (Revised Course) [June ...[Question Paper] Object Oriented Programming With C++ (Revised Course) [June ...
[Question Paper] Object Oriented Programming With C++ (Revised Course) [June ...
 
History of c++
History of c++History of c++
History of c++
 
C++ language
C++ languageC++ language
C++ language
 
Internet Technology (October – 2016) [Revised Syllabus | Question Paper]
Internet Technology (October – 2016) [Revised Syllabus | Question Paper]Internet Technology (October – 2016) [Revised Syllabus | Question Paper]
Internet Technology (October – 2016) [Revised Syllabus | Question Paper]
 
The D Programming Language - Why I love it!
The D Programming Language - Why I love it!The D Programming Language - Why I love it!
The D Programming Language - Why I love it!
 
D programming language
D programming languageD programming language
D programming language
 
15CS664 Python Question Bank-3
15CS664 Python Question Bank-315CS664 Python Question Bank-3
15CS664 Python Question Bank-3
 
Functional Programming Concepts for Imperative Programmers
Functional Programming Concepts for Imperative ProgrammersFunctional Programming Concepts for Imperative Programmers
Functional Programming Concepts for Imperative Programmers
 
[C++ korea] effective modern c++ study item 4 - 6 신촌
[C++ korea] effective modern c++ study   item 4 - 6 신촌[C++ korea] effective modern c++ study   item 4 - 6 신촌
[C++ korea] effective modern c++ study item 4 - 6 신촌
 
[Question Paper] Object Oriented Programming With C++ (Revised Course) [Janua...
[Question Paper] Object Oriented Programming With C++ (Revised Course) [Janua...[Question Paper] Object Oriented Programming With C++ (Revised Course) [Janua...
[Question Paper] Object Oriented Programming With C++ (Revised Course) [Janua...
 
15CS664- Python Application Programming- Question bank 1
15CS664- Python Application Programming- Question bank 115CS664- Python Application Programming- Question bank 1
15CS664- Python Application Programming- Question bank 1
 
[Question Paper] Introduction To C++ Programming (Revised Course) [January / ...
[Question Paper] Introduction To C++ Programming (Revised Course) [January / ...[Question Paper] Introduction To C++ Programming (Revised Course) [January / ...
[Question Paper] Introduction To C++ Programming (Revised Course) [January / ...
 
[Question Paper] Introduction To C++ Programming (Revised Course) [April / 2015]
[Question Paper] Introduction To C++ Programming (Revised Course) [April / 2015][Question Paper] Introduction To C++ Programming (Revised Course) [April / 2015]
[Question Paper] Introduction To C++ Programming (Revised Course) [April / 2015]
 
[Question Paper] Object Oriented Programming With C++ (Revised Course) [April...
[Question Paper] Object Oriented Programming With C++ (Revised Course) [April...[Question Paper] Object Oriented Programming With C++ (Revised Course) [April...
[Question Paper] Object Oriented Programming With C++ (Revised Course) [April...
 
Java and Data Structure (September - 2013) [Revised Course | Question Paper]
Java and Data Structure (September - 2013) [Revised Course | Question Paper]Java and Data Structure (September - 2013) [Revised Course | Question Paper]
Java and Data Structure (September - 2013) [Revised Course | Question Paper]
 

En vedette (7)

TRABAJANDO EN "EDMODO"
TRABAJANDO EN "EDMODO"TRABAJANDO EN "EDMODO"
TRABAJANDO EN "EDMODO"
 
Ejercicio 10
Ejercicio 10Ejercicio 10
Ejercicio 10
 
Bachelors diploma
Bachelors diplomaBachelors diploma
Bachelors diploma
 
Canaoeste e iac realizam dia de campo
Canaoeste e iac realizam dia de campoCanaoeste e iac realizam dia de campo
Canaoeste e iac realizam dia de campo
 
Patrimonio cultural de colombia. ec
Patrimonio cultural de colombia. ecPatrimonio cultural de colombia. ec
Patrimonio cultural de colombia. ec
 
Champion Care Corp Overview
Champion Care Corp OverviewChampion Care Corp Overview
Champion Care Corp Overview
 
raychem Kits adjacent to this range, both overlap this range.
raychem Kits adjacent to this range, both overlap this range.raychem Kits adjacent to this range, both overlap this range.
raychem Kits adjacent to this range, both overlap this range.
 

Similaire à F# Ignite - DNAD2010

Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010
Satish Verma
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming Paradigms
Janeve George
 
20100730 phpstudy
20100730 phpstudy20100730 phpstudy
20100730 phpstudy
Yusuke Ando
 

Similaire à F# Ignite - DNAD2010 (20)

F# Functional and MultiCore Programming
F# Functional and MultiCore Programming F# Functional and MultiCore Programming
F# Functional and MultiCore Programming
 
F# and the DLR
F# and the DLRF# and the DLR
F# and the DLR
 
Reproducibility with R
Reproducibility with RReproducibility with R
Reproducibility with R
 
Twins: Object Oriented Programming and Functional Programming
Twins: Object Oriented Programming and Functional ProgrammingTwins: Object Oriented Programming and Functional Programming
Twins: Object Oriented Programming and Functional Programming
 
Map, Flatmap and Reduce are Your New Best Friends: Simpler Collections, Concu...
Map, Flatmap and Reduce are Your New Best Friends: Simpler Collections, Concu...Map, Flatmap and Reduce are Your New Best Friends: Simpler Collections, Concu...
Map, Flatmap and Reduce are Your New Best Friends: Simpler Collections, Concu...
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010
 
Special topics in finance lecture 2
Special topics in finance   lecture 2Special topics in finance   lecture 2
Special topics in finance lecture 2
 
"The F# Path to Relaxation", Don Syme
"The F# Path to Relaxation", Don Syme"The F# Path to Relaxation", Don Syme
"The F# Path to Relaxation", Don Syme
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming Paradigms
 
Preparing for Scala 3
Preparing for Scala 3Preparing for Scala 3
Preparing for Scala 3
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming Paradigms
 
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...
ClojureScript - Making Front-End development Fun again - John Stevenson - Cod...
 
Java 8 Lambda
Java 8 LambdaJava 8 Lambda
Java 8 Lambda
 
Intro to Functional Programming
Intro to Functional ProgrammingIntro to Functional Programming
Intro to Functional Programming
 
Functional Programming and Big Data
Functional Programming and Big DataFunctional Programming and Big Data
Functional Programming and Big Data
 
Lambdas & Streams
Lambdas & StreamsLambdas & Streams
Lambdas & Streams
 
Dev Concepts: Functional Programming
Dev Concepts: Functional ProgrammingDev Concepts: Functional Programming
Dev Concepts: Functional Programming
 
Programming Languages: some news for the last N years
Programming Languages: some news for the last N yearsProgramming Languages: some news for the last N years
Programming Languages: some news for the last N years
 
Python and Zope: An introduction (May 2004)
Python and Zope: An introduction (May 2004)Python and Zope: An introduction (May 2004)
Python and Zope: An introduction (May 2004)
 
20100730 phpstudy
20100730 phpstudy20100730 phpstudy
20100730 phpstudy
 

Plus de Rodrigo Vidal (7)

Fij
FijFij
Fij
 
F#3.0
F#3.0 F#3.0
F#3.0
 
Monadic Design
Monadic DesignMonadic Design
Monadic Design
 
C5, vb11, f3
C5, vb11, f3C5, vb11, f3
C5, vb11, f3
 
DevDay BH 2011 Programação Funcional
DevDay BH 2011 Programação FuncionalDevDay BH 2011 Programação Funcional
DevDay BH 2011 Programação Funcional
 
WebCamps Software Testing
WebCamps Software TestingWebCamps Software Testing
WebCamps Software Testing
 
Computacao em nuvem windows azure
Computacao em nuvem   windows azureComputacao em nuvem   windows azure
Computacao em nuvem windows azure
 

Dernier

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 

F# Ignite - DNAD2010

  • 2. Rodrigo Vidal Twitter: @rodrigovidal Blog: www.rodrigovidal.net  Focus on Software Architecture  F# and IronRuby/Ruby enthusiast.  .NetArchitects – Rio de Janeiro , user group member  Professional Scrum Developer Quem sou eu?
  • 3.  Old Paradigm  52 years old  Ignored by MainStream until now. Functional Programming
  • 4.  New Challenges  Process big amount of data  Escale to Clusters and Cores Functional- Why now?
  • 5.  Think out of the box  Functional Programming is “safe”  MultiCore and Cloud Computing applications  Functional Programming is obtaning market Why learn another language?
  • 7. Another way of thinking List<string> res = new List<string>(); foreach(Product p in Products) { if (p.UnitPrice > 75.0M) { res.Add(String.Format("{0} - ${1}", p.ProductName, p.UnitPrice)); } } var res = from p in Products where p.UnitPrice > 75.0M select string.Format("{0} - ${1}", p.ProductName, p.UnitPrice); return res;
  • 8. Functional Paradigm  Immutable Data  Ability to compose functions  Functions can be thread as data  Lazy Evalution  Pattern Matching
  • 9. Immutability “Values are immutable by default” let x = 3 let x = 4 error FS0037: Duplicate definition of value ‘x'
  • 10. Side-Effects  A side effect  Modifies some state  Has observable interaction with calling functions  Has observable interaction with the outside world  Example: a function or method with no return value let mutable x = 3 let y = x*3 x <- 4 let z = x*3
  • 11. Composing Functions f(x) = 3x+2 g(y) = 4y-1 Z = g(f(2)) = ? f(x) g(x) let f x = 3*x + 2 let g y = (4*y) - 1 let z = g(f(2))
  • 13. Languages Evolution 0 2 4 6 8 10 12 0 2 4 6 8 10 12 Usefulness Safety C# Nirvana Haskell LINQ C#, VB, Java LINQ Nirvana Haskell http://channel9.msdn.com/posts/Charles/Simon-Peyton-Jones-Towards-a-Programming-Language-Nirvana/ C#, VB, Java, C are imperative programming languages. Very useful but can change the state of the world at anytime creating side effects. Nirvana! Useful and Safe Haskell is Very Safe, but not very useful. Used heavily in research and academia, but rarely in business. F#
  • 14. What´s is F#?  Functional language developed by Microsoft Research  By Don Syme and his team, who productized Generics  Based on OCaml (influenced by C# and Haskell)
  • 15. F# Evolution 2002 F# language design started 2005 January F# 1.0.1 releases to public 2005 November F# 1.1.5 with VS 2005 RTM support 2009 October VS2010 Beta 2, CTP for VS2008 & Non- Windows users 2010 F# is “productized” and baked into VS 2010
  • 16. F# 2.0 Functional + Objects + .NET + Async + Parallel + Interactive + Scripting
  • 17. F# 2.0 //F# open System let a = 2 Console.WriteLine a //C# using System; namespace ConsoleApplication1 { class Program { static int a() { return 2; } static void Main(string[] args) { Console.WriteLine(a); } } }
  • 18. let fim = “Obrigado”