SlideShare une entreprise Scribd logo
1  sur  34
F#nctional and MultiCore
Programming
Rodrigo Vidal
Quem sou eu?
Rodrigo Vidal
Twitter: @rodrigovidal
Blog: www.rodrigovidal.net
•Focado em Arquitetura de Software e Boas Práticas.
•Agilista e entusiasta de F# e IronRuby/Ruby.
•Membro ativo do grupo .NetArchitects
•Professional Scrum Developer
•Presente no maiores eventos do tecnologia do país.
Agenda
• MultiCore
• Functional Paradigm
• F# Language
Functional Programming
• Velho Paradigma
• 52 anos hoje
• Ignorado pelo MainStream até agora
Functional – Why now?
• Novo desafios
• Processar grandes quantidades de dados
• Escalabilidade para Cores e Clusters
• Declarative Programming
Why another language?
• Programação Funcional está por ai a um
longo tempo.
– Não é algo novo
– Tem uma longa história
• Programação Funcional é “safe”
– Devemos nos preocupar principalmente
quando lidamos com aplicações MultiCore e
de Cloud Computing
• Programção Funcional está crescendo!
“What” rather than “How”
Imperativo Vs. Declarativo
Quem usa ForEach() ?
|
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;
Domain Driven Design
Foco no Core Domain, revelando a
intenção do seu código.
Interfaces Reveladoras de Intenções
Concurrency-Friendly
Imperative-Problems:
•É dificil tornar codigo sequencial em
paralelo.
•É dificil usar “Shared States” e “Locks”
The Functional Paradigm
• Immutable Data
• Ability to compose functions
• Functions can be thread as data
• Lazy Evalution
• Pattern Matching
Immutability
“Values are immutable by default”
Side-Effects
– Also knowed as “The Butterfly Effect”
• 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
Composing Functions
f(x) = 3x+2
g(y) = 4y-1
g(f(2)) = ?
f(x)
g(x)
Motivação
#Inception
Language Evolution
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#F#
F# Evolution
What 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# 1.0
Functional + Objects + .NET
F# 2.0
Functional + Objects + .NET +
Async + Parallel + Interactive +
Scripting
F# 2.0
Functional + Objects + .NET +
Async + Parallel + Interactive +
Scripting
F# 2.0
• Succinct, Expressive, Functional
– Productive, simple, powerful, and fun language
• Parallel, Explorative, Data-rich, Algorithmic
– Extends the .NET platform to important new audiences
• Innovative, Industry/Platform-Leading
– Async, parallel, easy-objects, immutability, tuples, units-
of-measure
• Note: F# is not a replacement for C#/VB/C++
– Complementary, interoperable and augments and builds
on .NET as multi-lang platform
let demo = “Code!”
Let’s Go Parallel
The Free Lunch is Over
Why not 10GHz?
Software
Matrix Revolution
Parallel
Pattern
Library
Resource Manager
Task Scheduler
Task Parallel Library
Parallel LINQ
Threads
Native Concurrency Runtime
Managed Libraries
ThreadPool DataStructures
DataStructures
Tools
Async
Agents
Library
UMS Threads
Microsoft
Research
Visual
Studio 2010
Parallel
Debugger
Windows
Profiler
Concurrency
Analysis
Race
Detection
Fuzzing
AxumVisual F#
Managed Languages
Rx
Native Libraries
Managed Concurrency Runtime
DryadLINQ
Research /
Incubation
Research /
Incubation
Visual Studio 2010 / .NET 4 Windows 7 / Server 2008 R2
HPC Server
Operating
System
Parallel Computing and PDC09
Imperative Parallelism
Declarative Data Parallelism
CODE!
Amdahl’s Law (1 / percent of time spent in
sequential processing)
Limits of Parallelism
GPU – Beyond CPU
CODE!
The F#ture
Latest Books about F#

Contenu connexe

Similaire à F#nctional and MultiCore Programming

F# Ignite - DNAD2010
F# Ignite - DNAD2010F# Ignite - DNAD2010
F# Ignite - DNAD2010Rodrigo Vidal
 
Bay NET Aug 19 2009 presentation ppt
Bay  NET Aug 19 2009 presentation pptBay  NET Aug 19 2009 presentation ppt
Bay NET Aug 19 2009 presentation pptArt Scott
 
The Ring programming language version 1.7 book - Part 6 of 196
The Ring programming language version 1.7 book - Part 6 of 196The Ring programming language version 1.7 book - Part 6 of 196
The Ring programming language version 1.7 book - Part 6 of 196Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 5 of 181
The Ring programming language version 1.5.2 book - Part 5 of 181The Ring programming language version 1.5.2 book - Part 5 of 181
The Ring programming language version 1.5.2 book - Part 5 of 181Mahmoud Samir Fayed
 
Object oriented slides
Object oriented slidesObject oriented slides
Object oriented slidesahad nadeem
 
"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 SymeFwdays
 
C# .NET - Um overview da linguagem
C# .NET - Um overview da linguagem C# .NET - Um overview da linguagem
C# .NET - Um overview da linguagem Claudson Oliveira
 
The Ring programming language version 1.4.1 book - Part 2 of 31
The Ring programming language version 1.4.1 book - Part 2 of 31The Ring programming language version 1.4.1 book - Part 2 of 31
The Ring programming language version 1.4.1 book - Part 2 of 31Mahmoud Samir Fayed
 
Open Source .NET
Open Source .NETOpen Source .NET
Open Source .NETOnyxfish
 
The Ring programming language version 1.10 book - Part 6 of 212
The Ring programming language version 1.10 book - Part 6 of 212The Ring programming language version 1.10 book - Part 6 of 212
The Ring programming language version 1.10 book - Part 6 of 212Mahmoud Samir Fayed
 
Ten compelling reasons to learn .net framework
Ten compelling reasons to learn .net frameworkTen compelling reasons to learn .net framework
Ten compelling reasons to learn .net frameworkJanBask Training
 
The Ring programming language version 1.4 book - Part 2 of 30
The Ring programming language version 1.4 book - Part 2 of 30The Ring programming language version 1.4 book - Part 2 of 30
The Ring programming language version 1.4 book - Part 2 of 30Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 6 of 210
The Ring programming language version 1.9 book - Part 6 of 210The Ring programming language version 1.9 book - Part 6 of 210
The Ring programming language version 1.9 book - Part 6 of 210Mahmoud Samir Fayed
 
Top 10 Programming Languages 2023.docx
Top 10 Programming Languages 2023.docxTop 10 Programming Languages 2023.docx
Top 10 Programming Languages 2023.docxAdvance Tech
 
The Ring programming language version 1.8 book - Part 6 of 202
The Ring programming language version 1.8 book - Part 6 of 202The Ring programming language version 1.8 book - Part 6 of 202
The Ring programming language version 1.8 book - Part 6 of 202Mahmoud Samir Fayed
 
Introduction to Python GUI development with Delphi for Python - Part 1: Del...
Introduction to Python GUI development with Delphi for Python - Part 1:   Del...Introduction to Python GUI development with Delphi for Python - Part 1:   Del...
Introduction to Python GUI development with Delphi for Python - Part 1: Del...Embarcadero Technologies
 

Similaire à F#nctional and MultiCore Programming (20)

F# Ignite - DNAD2010
F# Ignite - DNAD2010F# Ignite - DNAD2010
F# Ignite - DNAD2010
 
Bay NET Aug 19 2009 presentation ppt
Bay  NET Aug 19 2009 presentation pptBay  NET Aug 19 2009 presentation ppt
Bay NET Aug 19 2009 presentation ppt
 
The Ring programming language version 1.7 book - Part 6 of 196
The Ring programming language version 1.7 book - Part 6 of 196The Ring programming language version 1.7 book - Part 6 of 196
The Ring programming language version 1.7 book - Part 6 of 196
 
The Ring programming language version 1.5.2 book - Part 5 of 181
The Ring programming language version 1.5.2 book - Part 5 of 181The Ring programming language version 1.5.2 book - Part 5 of 181
The Ring programming language version 1.5.2 book - Part 5 of 181
 
Object oriented slides
Object oriented slidesObject oriented slides
Object oriented slides
 
Lecture 11
Lecture 11Lecture 11
Lecture 11
 
"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
 
C# handout.docx
C# handout.docxC# handout.docx
C# handout.docx
 
C# .NET - Um overview da linguagem
C# .NET - Um overview da linguagem C# .NET - Um overview da linguagem
C# .NET - Um overview da linguagem
 
The Ring programming language version 1.4.1 book - Part 2 of 31
The Ring programming language version 1.4.1 book - Part 2 of 31The Ring programming language version 1.4.1 book - Part 2 of 31
The Ring programming language version 1.4.1 book - Part 2 of 31
 
Open Source .NET
Open Source .NETOpen Source .NET
Open Source .NET
 
The Ring programming language version 1.10 book - Part 6 of 212
The Ring programming language version 1.10 book - Part 6 of 212The Ring programming language version 1.10 book - Part 6 of 212
The Ring programming language version 1.10 book - Part 6 of 212
 
Ten compelling reasons to learn .net framework
Ten compelling reasons to learn .net frameworkTen compelling reasons to learn .net framework
Ten compelling reasons to learn .net framework
 
The Ring programming language version 1.4 book - Part 2 of 30
The Ring programming language version 1.4 book - Part 2 of 30The Ring programming language version 1.4 book - Part 2 of 30
The Ring programming language version 1.4 book - Part 2 of 30
 
C#.pptx
C#.pptxC#.pptx
C#.pptx
 
The Poly Pinoy
The Poly PinoyThe Poly Pinoy
The Poly Pinoy
 
The Ring programming language version 1.9 book - Part 6 of 210
The Ring programming language version 1.9 book - Part 6 of 210The Ring programming language version 1.9 book - Part 6 of 210
The Ring programming language version 1.9 book - Part 6 of 210
 
Top 10 Programming Languages 2023.docx
Top 10 Programming Languages 2023.docxTop 10 Programming Languages 2023.docx
Top 10 Programming Languages 2023.docx
 
The Ring programming language version 1.8 book - Part 6 of 202
The Ring programming language version 1.8 book - Part 6 of 202The Ring programming language version 1.8 book - Part 6 of 202
The Ring programming language version 1.8 book - Part 6 of 202
 
Introduction to Python GUI development with Delphi for Python - Part 1: Del...
Introduction to Python GUI development with Delphi for Python - Part 1:   Del...Introduction to Python GUI development with Delphi for Python - Part 1:   Del...
Introduction to Python GUI development with Delphi for Python - Part 1: Del...
 

Plus de Rodrigo Vidal

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

Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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 organizationRadu Cotescu
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
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 Servicegiselly40
 
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 slidevu2urc
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
[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.pdfhans926745
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
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...Miguel Araújo
 

Dernier (20)

Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.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
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
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
 
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
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
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...
 

F#nctional and MultiCore Programming

Notes de l'éditeur

  1. List&amp;lt;string&amp;gt; res = new List&amp;lt;string&amp;gt;(); #1 foreach(Product p in Products) { #2 if (p.UnitPrice &amp;gt; 75.0M) { res.Add(String.Format(&amp;quot;{0} - ${1}&amp;quot;, p.ProductName, p.UnitPrice)); #3 } } var res = from p in Products where p.UnitPrice &amp;gt; 75.0M #1 select string.Format(&amp;quot;{0} - ${1}&amp;quot;, p.ProductName, p.UnitPrice); #2 return res;
  2. C# Parallel.For(1,inp.Length-1,i =&amp;gt; { var sum = inp[i-1] + inp[i] + inp[i+1]; res[i] = sum / 3; }); F# let pfor nfrom nto f = Parallel.For(nfrom, nto + 1, Action&amp;lt;_&amp;gt;(f)) pfor 1 (inp.Length-2) (fun i -&amp;gt; let sum = inp.[i-1] + inp.[i] + inp.[i+1] res.[i] &amp;lt;- sum / 3 )
  3. The key idea behind the declarative style of programming is that the code doesn&amp;apos;t specify how exactly it should be executed. Execution is provided by a minimal number of primitives such as select and where in LINQ or map and filter in F#, and these primitives can behave in a sophisticated way.
  4. The key idea behind the declarative style of programming is that the code doesn&amp;apos;t specify how exactly it should be executed. Execution is provided by a minimal number of primitives such as select and where in LINQ or map and filter in F#, and these primitives can behave in a sophisticated way.
  5. The key idea behind the declarative style of programming is that the code doesn&amp;apos;t specify how exactly it should be executed. Execution is provided by a minimal number of primitives such as select and where in LINQ or map and filter in F#, and these primitives can behave in a sophisticated way.
  6. The key idea behind the declarative style of programming is that the code doesn&amp;apos;t specify how exactly it should be executed. Execution is provided by a minimal number of primitives such as select and where in LINQ or map and filter in F#, and these primitives can behave in a sophisticated way.