SlideShare a Scribd company logo
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

More Related Content

Similar to Why Go is an important programming language (20)

PDF
Just Keep Passing The Messages
Russel Winder
 
PDF
ACCU 2012: Go, D, C++ and The Multicore Revolution
Russel Winder
 
PDF
GPars 2014
Russel Winder
 
PDF
Why Groovy When Java 8 or Scala, or…
Russel Winder
 
PDF
Testing: Python, Java, Groovy, etc.
Russel Winder
 
ODP
GPars: Groovy Parallelism for Java
Russel Winder
 
PDF
Java 8: a New Beginning
Russel Winder
 
PDF
GPars Remoting
Russel Winder
 
PDF
Switch to Python 3…now…immediately
Russel Winder
 
PDF
Gant, the lightweight and Groovy targeted scripting framework
Skills Matter
 
PDF
On the Architectures of Microservices: the next layer
Russel Winder
 
PDF
Closures: The Next "Big Thing" In Java
Russel Winder
 
PDF
Closures, the next "Big Thing" in Java: Russel Winder
JAX London
 
PDF
More Than Java Concurrency
Fuqiang Wang
 
PDF
Chapter 1 introduction
Tamrat Amare
 
PPT
distcomp.ppt
Sathya266487
 
PPT
distcomp.ppt
kaoutarghaffour
 
PPT
distcomp.ppt
kaoutarghaffour
 
PDF
Concurrency for dummies
Azrul MADISA
 
PPT
Chapter00000000
Mani Deepak Choudhry
 
Just Keep Passing The Messages
Russel Winder
 
ACCU 2012: Go, D, C++ and The Multicore Revolution
Russel Winder
 
GPars 2014
Russel Winder
 
Why Groovy When Java 8 or Scala, or…
Russel Winder
 
Testing: Python, Java, Groovy, etc.
Russel Winder
 
GPars: Groovy Parallelism for Java
Russel Winder
 
Java 8: a New Beginning
Russel Winder
 
GPars Remoting
Russel Winder
 
Switch to Python 3…now…immediately
Russel Winder
 
Gant, the lightweight and Groovy targeted scripting framework
Skills Matter
 
On the Architectures of Microservices: the next layer
Russel Winder
 
Closures: The Next "Big Thing" In Java
Russel Winder
 
Closures, the next "Big Thing" in Java: Russel Winder
JAX London
 
More Than Java Concurrency
Fuqiang Wang
 
Chapter 1 introduction
Tamrat Amare
 
distcomp.ppt
Sathya266487
 
distcomp.ppt
kaoutarghaffour
 
distcomp.ppt
kaoutarghaffour
 
Concurrency for dummies
Azrul MADISA
 
Chapter00000000
Mani Deepak Choudhry
 

More from Russel Winder (18)

PDF
On Concurrency and Parallelism in the JVMverse
Russel Winder
 
PDF
The Case for Kotlin and Ceylon
Russel Winder
 
PDF
Fast Python? Don't Bother
Russel Winder
 
PDF
Making Python computations fast
Russel Winder
 
PDF
Tales from the Workshops
Russel Winder
 
PDF
Making Computations Execute Very Quickly
Russel Winder
 
PDF
Java is Dead, Long Live Ceylon, Kotlin, etc
Russel Winder
 
PDF
Java is dead, long live Scala, Kotlin, Ceylon, etc.
Russel Winder
 
PDF
Spocktacular testing
Russel Winder
 
PDF
Spocktacular Testing
Russel Winder
 
PDF
Is Groovy static or dynamic
Russel Winder
 
PDF
Java is dead, long live Scala Kotlin Ceylon etc.
Russel Winder
 
PDF
Dataflow: the concurrency/parallelism architecture you need
Russel Winder
 
PDF
Are Go and D threats to Python
Russel Winder
 
PDF
Is Groovy as fast as Java
Russel Winder
 
PDF
GroovyFX: or how to program JavaFX easily
Russel Winder
 
PDF
Given Groovy Who Needs Java
Russel Winder
 
PDF
GPars
Russel Winder
 
On Concurrency and Parallelism in the JVMverse
Russel Winder
 
The Case for Kotlin and Ceylon
Russel Winder
 
Fast Python? Don't Bother
Russel Winder
 
Making Python computations fast
Russel Winder
 
Tales from the Workshops
Russel Winder
 
Making Computations Execute Very Quickly
Russel Winder
 
Java is Dead, Long Live Ceylon, Kotlin, etc
Russel Winder
 
Java is dead, long live Scala, Kotlin, Ceylon, etc.
Russel Winder
 
Spocktacular testing
Russel Winder
 
Spocktacular Testing
Russel Winder
 
Is Groovy static or dynamic
Russel Winder
 
Java is dead, long live Scala Kotlin Ceylon etc.
Russel Winder
 
Dataflow: the concurrency/parallelism architecture you need
Russel Winder
 
Are Go and D threats to Python
Russel Winder
 
Is Groovy as fast as Java
Russel Winder
 
GroovyFX: or how to program JavaFX easily
Russel Winder
 
Given Groovy Who Needs Java
Russel Winder
 
Ad

Recently uploaded (20)

PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Digital Circuits, important subject in CS
contactparinay1
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Ad

Why Go is an important programming language

  • 1. Why Go is an Important Language Prof Russel Winder email: [email protected] xmpp: [email protected] 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: [email protected] xmpp: [email protected] twitter: russel_winder Copyright © 2013 Russel Winder 51