SlideShare ist ein Scribd-Unternehmen logo
1 von 51
Downloaden Sie, um offline zu lesen
Why Go is an
                             Important Language

                                 Prof Russel Winder
                                  email: russel@winder.org.uk
                                 xmpp: russel@winder.org.uk
                                    twitter: russel_winder




Copyright © 2013 Russel Winder                                  1
Interstitial Advertisement




                                                     ?

Copyright © 2013 Russel Winder                           2
controversial
           adjective
              of, pertaining to, or characteristic of controversy;
              polemical




Copyright © 2013 Russel Winder                                       3
controversy
           noun
              dispute, argument, or debate, especially one
              concerning a matter about which there is
              strong disagreement




Copyright © 2013 Russel Winder                               4
polemic
           noun
              a strong verbal or written attack on
              someone or something




Copyright © 2013 Russel Winder                       5
Go, made public late 2009.




Copyright © 2013 Russel Winder                          6
It's a better C.




Copyright © 2013 Russel Winder                      7
Strong, static type checking.




Copyright © 2013 Russel Winder                            8
Garbage collected.




Copyright © 2013 Russel Winder                        9
Statically linked.




Copyright © 2013 Russel Winder                        10
Aware of DVCS repositories.




Copyright © 2013 Russel Winder                          11
No classes.




Copyright © 2013 Russel Winder                 12
Separation of state and behaviour.




Copyright © 2013 Russel Winder                        13
Focus on modern, multicore hardware.




Copyright © 2013 Russel Winder                    14
Concurrency is a tool for structuring execution where a
      single processor is used by multiple computations.


      Parallelism is about making a computation complete
                faster than using a single processor.




Copyright © 2013 Russel Winder                                15
Parallelism is performance improvement.


     Performance improvement requires parallelism.




Copyright © 2013 Russel Winder                         16
People should tremble in fear

                                 at the prospect of using


                                    mutable
                            shared-memory
                          multithreading.
Copyright © 2013 Russel Winder                              17
Locks deny parallelism.

                       The whole purpose of a lock is to
                             prevent parallelism.




Copyright © 2013 Russel Winder                             18
Locks are needed only if
                           there is mutable shared state.




Copyright © 2013 Russel Winder                              19
Avoid mutable shared state.




Copyright © 2013 Russel Winder                          20
Use processes and message passing.




Copyright © 2013 Russel Winder                           21
It's all easier if processes
                                    are single threaded.




Copyright © 2013 Russel Winder                                  22
Applications and tools programmers
                    need computational models with
                       integrated synchronization.




Copyright © 2013 Russel Winder                          23
Actors                       Dataflow
     Independent processes        Operators connected by
     communicating via            channels with activity
     asynchronous exchange        triggered by arrival of
     of messages                  data on the channels.




    CSP                          Data Parallelism
    Sequential processes
                                 Transform a sequence to
    connected by channels
                                 another sequence where all
    using synchronous message
                                 individual actions happen
    exchange (rendezvous).
                                 at the same time.

Copyright © 2013 Russel Winder                                24
Data Parallelism
                                 Transform a sequence to
                                 another sequence where all
                                 individual actions happen
                                 at the same time.

Copyright © 2013 Russel Winder                                25
Actors
     Independent processes
     communicating via
     asynchronous exchange
     of messages




Copyright © 2013 Russel Winder   26
Dataflow
                                 Operators connected by
                                 channels with activity
                                 triggered by arrival of
                                 data on the channels.




Copyright © 2013 Russel Winder                             27
CSP
    Sequential processes
    connected by channels
    using synchronous message
    exchange (rendezvous).

Copyright © 2013 Russel Winder   28
Actors                       Dataflow
     Independent processes        Operators connected by
     communicating via            channels with activity
     asynchronous exchange        triggered by arrival of
     of messages                  data on the channels.




    CSP                          Data Parallelism
    Sequential processes
                                 Transform a sequence to
    connected by channels
                                 another sequence where all
    using synchronous message
                                 individual actions happen
    exchange (rendezvous).
                                 at the same time.

Copyright © 2013 Russel Winder                                29
Agents
                                         A wrapper for some
    Active Objects                       shared mutable state.
    An object that is actually
    an actor but looks like a
    full service object.
                                 Fork/Join
                                 An toolkit for tree structured
                                 concurrency and parallelism.


        Software Transactional Memory
        Wrappers for mutable values that uses transactions
        rather than locks.
Copyright © 2013 Russel Winder                                    30
Example.




Copyright © 2013 Russel Winder              31

Copyright © 2013 Russel Winder       32
What is the Value of           ?

                                 Easy, it's known exactly.

                                          It's .

                                        Obviously.



Copyright © 2013 Russel Winder                                33
It's simples
                                          Александр Орлов   2009




Copyright © 2013 Russel Winder                                     34
Approximating 
     ●   What is it's value represented as a floating point
         number?
           ●   We can only obtain an approximation.
           ●   A plethora of possible algorithms to choose from, a
               popular one is to employ the following integral
               equation.


                                              1  1
                                             =∫0       dx
                                           4     1x 2




Copyright © 2013 Russel Winder                                       35
One Possible Algorithm
     ●   Use quadrature to estimate the value of the integral
         – which is the area under the curve.
                                   4 n          1
                                 = ∑i=1
                                   n           i−0.5 2
   Embarrassingly                          1      
   parallel.                                      n


                                                With n = 3 not much to do,
                                                but potentially lots of error.
                                                Use n = 107 or n = 109?



Copyright © 2013 Russel Winder                                                   36
Because addition is commutative and
                   associative, expression can be
               decomposed into sums of partial sums.




Copyright © 2013 Russel Winder                         37
a+b+c+d+e+f

                                      =

                         (a+b)+(c+d)+(e+f)




Copyright © 2013 Russel Winder                 38
Scatter – Gather




                                 map         reduce
Copyright © 2013 Russel Winder                        39
Code!



Copyright © 2013 Russel Winder           40
If you want the code, clone the Git repository:

      http://www.russel.org.uk/Git/Pi_Quadrature.git




Copyright © 2013 Russel Winder                           41
Or if you just want to browse:

                        http://www.russel.org.uk/gitweb




Copyright © 2013 Russel Winder                              42
Multicore and multiprocessor are now
                the norm, not the exception.




Copyright © 2013 Russel Winder                     43
Parallelism only matters if
             computational performance matters.




Copyright © 2013 Russel Winder                    44
Unstructured synchronization
                           of concurrent systems
                        is not a feasible approach.




Copyright © 2013 Russel Winder                        45
Actors, CSP, Dataflow, and
                                 Data parallelism
                                 are the future of
                              applications structure.




Copyright © 2013 Russel Winder                            46
Passing messages between
                        processes is the way forward.




Copyright © 2013 Russel Winder                          47
Shared memory concurrency
                       is a dead end for applications.




Copyright © 2013 Russel Winder                           48
Goroutines

                                    and

                                 channels



Copyright © 2013 Russel Winder                49
Interstitial Advertisement




                                                     ?

Copyright © 2013 Russel Winder                           50
Why Go is an
                             Important Language

                                 Prof Russel Winder
                                  email: russel@winder.org.uk
                                 xmpp: russel@winder.org.uk
                                    twitter: russel_winder




Copyright © 2013 Russel Winder                                  51

Weitere ähnliche Inhalte

Mehr von Russel Winder

On Concurrency and Parallelism in the JVMverse
On Concurrency and Parallelism in the JVMverseOn Concurrency and Parallelism in the JVMverse
On Concurrency and Parallelism in the JVMverseRussel Winder
 
The Case for Kotlin and Ceylon
The Case for Kotlin and CeylonThe Case for Kotlin and Ceylon
The Case for Kotlin and CeylonRussel Winder
 
On the Architectures of Microservices: the next layer
On the Architectures of Microservices: the next layerOn the Architectures of Microservices: the next layer
On the Architectures of Microservices: the next layerRussel Winder
 
Fast Python? Don't Bother
Fast Python? Don't BotherFast Python? Don't Bother
Fast Python? Don't BotherRussel Winder
 
Making Python computations fast
Making Python computations fastMaking Python computations fast
Making Python computations fastRussel Winder
 
Tales from the Workshops
Tales from the WorkshopsTales from the Workshops
Tales from the WorkshopsRussel Winder
 
Making Computations Execute Very Quickly
Making Computations Execute Very QuicklyMaking Computations Execute Very Quickly
Making Computations Execute Very QuicklyRussel Winder
 
Java is Dead, Long Live Ceylon, Kotlin, etc
Java is Dead,  Long Live Ceylon, Kotlin, etcJava is Dead,  Long Live Ceylon, Kotlin, etc
Java is Dead, Long Live Ceylon, Kotlin, etcRussel Winder
 
Java is dead, long live Scala, Kotlin, Ceylon, etc.
Java is dead, long live Scala, Kotlin, Ceylon, etc.Java is dead, long live Scala, Kotlin, Ceylon, etc.
Java is dead, long live Scala, Kotlin, Ceylon, etc.Russel Winder
 
Spocktacular testing
Spocktacular testingSpocktacular testing
Spocktacular testingRussel Winder
 
Spocktacular Testing
Spocktacular TestingSpocktacular Testing
Spocktacular TestingRussel Winder
 
Is Groovy static or dynamic
Is Groovy static or dynamicIs Groovy static or dynamic
Is Groovy static or dynamicRussel Winder
 
Java is dead, long live Scala Kotlin Ceylon etc.
Java is dead, long live Scala Kotlin Ceylon etc.Java is dead, long live Scala Kotlin Ceylon etc.
Java is dead, long live Scala Kotlin Ceylon etc.Russel Winder
 
Are Go and D threats to Python
Are Go and D threats to PythonAre Go and D threats to Python
Are Go and D threats to PythonRussel Winder
 
Is Groovy as fast as Java
Is Groovy as fast as JavaIs Groovy as fast as Java
Is Groovy as fast as JavaRussel Winder
 
Java 8: a New Beginning
Java 8: a New BeginningJava 8: a New Beginning
Java 8: a New BeginningRussel Winder
 
GPars: Groovy Parallelism for Java
GPars: Groovy Parallelism for JavaGPars: Groovy Parallelism for Java
GPars: Groovy Parallelism for JavaRussel Winder
 
GroovyFX: or how to program JavaFX easily
GroovyFX: or how to program JavaFX easily GroovyFX: or how to program JavaFX easily
GroovyFX: or how to program JavaFX easily Russel Winder
 
Switch to Python 3…now…immediately
Switch to Python 3…now…immediatelySwitch to Python 3…now…immediately
Switch to Python 3…now…immediatelyRussel Winder
 
Given Groovy Who Needs Java
Given Groovy Who Needs JavaGiven Groovy Who Needs Java
Given Groovy Who Needs JavaRussel Winder
 

Mehr von Russel Winder (20)

On Concurrency and Parallelism in the JVMverse
On Concurrency and Parallelism in the JVMverseOn Concurrency and Parallelism in the JVMverse
On Concurrency and Parallelism in the JVMverse
 
The Case for Kotlin and Ceylon
The Case for Kotlin and CeylonThe Case for Kotlin and Ceylon
The Case for Kotlin and Ceylon
 
On the Architectures of Microservices: the next layer
On the Architectures of Microservices: the next layerOn the Architectures of Microservices: the next layer
On the Architectures of Microservices: the next layer
 
Fast Python? Don't Bother
Fast Python? Don't BotherFast Python? Don't Bother
Fast Python? Don't Bother
 
Making Python computations fast
Making Python computations fastMaking Python computations fast
Making Python computations fast
 
Tales from the Workshops
Tales from the WorkshopsTales from the Workshops
Tales from the Workshops
 
Making Computations Execute Very Quickly
Making Computations Execute Very QuicklyMaking Computations Execute Very Quickly
Making Computations Execute Very Quickly
 
Java is Dead, Long Live Ceylon, Kotlin, etc
Java is Dead,  Long Live Ceylon, Kotlin, etcJava is Dead,  Long Live Ceylon, Kotlin, etc
Java is Dead, Long Live Ceylon, Kotlin, etc
 
Java is dead, long live Scala, Kotlin, Ceylon, etc.
Java is dead, long live Scala, Kotlin, Ceylon, etc.Java is dead, long live Scala, Kotlin, Ceylon, etc.
Java is dead, long live Scala, Kotlin, Ceylon, etc.
 
Spocktacular testing
Spocktacular testingSpocktacular testing
Spocktacular testing
 
Spocktacular Testing
Spocktacular TestingSpocktacular Testing
Spocktacular Testing
 
Is Groovy static or dynamic
Is Groovy static or dynamicIs Groovy static or dynamic
Is Groovy static or dynamic
 
Java is dead, long live Scala Kotlin Ceylon etc.
Java is dead, long live Scala Kotlin Ceylon etc.Java is dead, long live Scala Kotlin Ceylon etc.
Java is dead, long live Scala Kotlin Ceylon etc.
 
Are Go and D threats to Python
Are Go and D threats to PythonAre Go and D threats to Python
Are Go and D threats to Python
 
Is Groovy as fast as Java
Is Groovy as fast as JavaIs Groovy as fast as Java
Is Groovy as fast as Java
 
Java 8: a New Beginning
Java 8: a New BeginningJava 8: a New Beginning
Java 8: a New Beginning
 
GPars: Groovy Parallelism for Java
GPars: Groovy Parallelism for JavaGPars: Groovy Parallelism for Java
GPars: Groovy Parallelism for Java
 
GroovyFX: or how to program JavaFX easily
GroovyFX: or how to program JavaFX easily GroovyFX: or how to program JavaFX easily
GroovyFX: or how to program JavaFX easily
 
Switch to Python 3…now…immediately
Switch to Python 3…now…immediatelySwitch to Python 3…now…immediately
Switch to Python 3…now…immediately
 
Given Groovy Who Needs Java
Given Groovy Who Needs JavaGiven Groovy Who Needs Java
Given Groovy Who Needs Java
 

Kürzlich hochgeladen

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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.pptxHampshireHUG
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
[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
 
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
 
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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
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 2024The Digital Insurer
 
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.pptxMalak Abu Hammad
 
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.pptxKatpro Technologies
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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...Igalia
 

Kürzlich hochgeladen (20)

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
[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
 
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
 
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
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
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
 
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: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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...
 

Why Go is an important programming language

  • 1. Why Go is an Important Language Prof Russel Winder email: russel@winder.org.uk xmpp: russel@winder.org.uk twitter: russel_winder Copyright © 2013 Russel Winder 1
  • 2. Interstitial Advertisement ? Copyright © 2013 Russel Winder 2
  • 3. controversial adjective of, pertaining to, or characteristic of controversy; polemical Copyright © 2013 Russel Winder 3
  • 4. controversy noun dispute, argument, or debate, especially one concerning a matter about which there is strong disagreement Copyright © 2013 Russel Winder 4
  • 5. polemic noun a strong verbal or written attack on someone or something Copyright © 2013 Russel Winder 5
  • 6. Go, made public late 2009. Copyright © 2013 Russel Winder 6
  • 7. It's a better C. Copyright © 2013 Russel Winder 7
  • 8. Strong, static type checking. Copyright © 2013 Russel Winder 8
  • 9. Garbage collected. Copyright © 2013 Russel Winder 9
  • 10. Statically linked. Copyright © 2013 Russel Winder 10
  • 11. Aware of DVCS repositories. Copyright © 2013 Russel Winder 11
  • 12. No classes. Copyright © 2013 Russel Winder 12
  • 13. Separation of state and behaviour. Copyright © 2013 Russel Winder 13
  • 14. Focus on modern, multicore hardware. Copyright © 2013 Russel Winder 14
  • 15. Concurrency is a tool for structuring execution where a single processor is used by multiple computations. Parallelism is about making a computation complete faster than using a single processor. Copyright © 2013 Russel Winder 15
  • 16. Parallelism is performance improvement. Performance improvement requires parallelism. Copyright © 2013 Russel Winder 16
  • 17. People should tremble in fear at the prospect of using mutable shared-memory multithreading. Copyright © 2013 Russel Winder 17
  • 18. Locks deny parallelism. The whole purpose of a lock is to prevent parallelism. Copyright © 2013 Russel Winder 18
  • 19. Locks are needed only if there is mutable shared state. Copyright © 2013 Russel Winder 19
  • 20. Avoid mutable shared state. Copyright © 2013 Russel Winder 20
  • 21. Use processes and message passing. Copyright © 2013 Russel Winder 21
  • 22. It's all easier if processes are single threaded. Copyright © 2013 Russel Winder 22
  • 23. Applications and tools programmers need computational models with integrated synchronization. Copyright © 2013 Russel Winder 23
  • 24. Actors Dataflow Independent processes Operators connected by communicating via channels with activity asynchronous exchange triggered by arrival of of messages data on the channels. CSP Data Parallelism Sequential processes Transform a sequence to connected by channels another sequence where all using synchronous message individual actions happen exchange (rendezvous). at the same time. Copyright © 2013 Russel Winder 24
  • 25. Data Parallelism Transform a sequence to another sequence where all individual actions happen at the same time. Copyright © 2013 Russel Winder 25
  • 26. Actors Independent processes communicating via asynchronous exchange of messages Copyright © 2013 Russel Winder 26
  • 27. Dataflow Operators connected by channels with activity triggered by arrival of data on the channels. Copyright © 2013 Russel Winder 27
  • 28. CSP Sequential processes connected by channels using synchronous message exchange (rendezvous). Copyright © 2013 Russel Winder 28
  • 29. Actors Dataflow Independent processes Operators connected by communicating via channels with activity asynchronous exchange triggered by arrival of of messages data on the channels. CSP Data Parallelism Sequential processes Transform a sequence to connected by channels another sequence where all using synchronous message individual actions happen exchange (rendezvous). at the same time. Copyright © 2013 Russel Winder 29
  • 30. Agents A wrapper for some Active Objects shared mutable state. An object that is actually an actor but looks like a full service object. Fork/Join An toolkit for tree structured concurrency and parallelism. Software Transactional Memory Wrappers for mutable values that uses transactions rather than locks. Copyright © 2013 Russel Winder 30
  • 31. Example. Copyright © 2013 Russel Winder 31
  • 32.  Copyright © 2013 Russel Winder 32
  • 33. What is the Value of ? Easy, it's known exactly. It's . Obviously. Copyright © 2013 Russel Winder 33
  • 34. It's simples Александр Орлов 2009 Copyright © 2013 Russel Winder 34
  • 35. Approximating  ● What is it's value represented as a floating point number? ● We can only obtain an approximation. ● A plethora of possible algorithms to choose from, a popular one is to employ the following integral equation.  1 1 =∫0 dx 4 1x 2 Copyright © 2013 Russel Winder 35
  • 36. One Possible Algorithm ● Use quadrature to estimate the value of the integral – which is the area under the curve. 4 n 1 = ∑i=1 n i−0.5 2 Embarrassingly 1  parallel. n With n = 3 not much to do, but potentially lots of error. Use n = 107 or n = 109? Copyright © 2013 Russel Winder 36
  • 37. Because addition is commutative and associative, expression can be decomposed into sums of partial sums. Copyright © 2013 Russel Winder 37
  • 38. a+b+c+d+e+f = (a+b)+(c+d)+(e+f) Copyright © 2013 Russel Winder 38
  • 39. Scatter – Gather map reduce Copyright © 2013 Russel Winder 39
  • 40. Code! Copyright © 2013 Russel Winder 40
  • 41. If you want the code, clone the Git repository: http://www.russel.org.uk/Git/Pi_Quadrature.git Copyright © 2013 Russel Winder 41
  • 42. Or if you just want to browse: http://www.russel.org.uk/gitweb Copyright © 2013 Russel Winder 42
  • 43. Multicore and multiprocessor are now the norm, not the exception. Copyright © 2013 Russel Winder 43
  • 44. Parallelism only matters if computational performance matters. Copyright © 2013 Russel Winder 44
  • 45. Unstructured synchronization of concurrent systems is not a feasible approach. Copyright © 2013 Russel Winder 45
  • 46. Actors, CSP, Dataflow, and Data parallelism are the future of applications structure. Copyright © 2013 Russel Winder 46
  • 47. Passing messages between processes is the way forward. Copyright © 2013 Russel Winder 47
  • 48. Shared memory concurrency is a dead end for applications. Copyright © 2013 Russel Winder 48
  • 49. Goroutines and channels Copyright © 2013 Russel Winder 49
  • 50. Interstitial Advertisement ? Copyright © 2013 Russel Winder 50
  • 51. Why Go is an Important Language Prof Russel Winder email: russel@winder.org.uk xmpp: russel@winder.org.uk twitter: russel_winder Copyright © 2013 Russel Winder 51