SlideShare una empresa de Scribd logo
1 de 25
GO: What’s Different ?
Tarun Vashisth
28th Sep 2018
Contents
• Programming Languages
• History
• Challenges
• Concurrency
• Object Oriented Design
• Type system and more
• Presence
• References
Languages
History
• 1950’s: Fortran, Lisp, Algol, Cobol
• 1960-70’s: B, Pascal, C, Prolog, SQL
• 1980’s: C++, Ada, Matlab, Erlang, Perl
• 1990’s(Internet age): Haskell, Python, VB, R, Ruby, Java, PHP,
JavaScript
• 2000’s: ActionScript, C#, D, Groovy, Scala, Clojure, Go, Rust, Kotlin,
Swift
• CULTURE ?
Challenges: Hardware limitations
• A fundamental turn towards concurrency in software
• Well, 3GHz CPUs -> 2004 and today -> MacBookPro@2.7GHz.
Challenges: Hardware limitations
• Resort to multicore
• Cannot scale indefinitely
• Comes with synchronization overhead between the operations.
• Increase transistor per unit area on chip?
Challenges: Multithreaded design
• Traditional programming languages -> 90’s -> traditional single-
threaded processes.
• Multi-threading
• Messy, complicated and expensive.
• Significant setup and teardown costs.
• We cool ?
Challenges: Multithreaded design
• Real problem:
• Concurrent execution
• Threading-locking
• Race conditions
• Deadlocks.
• Go: Designed keeping in mind multiple cores
• Famous paper “Communicating Sequential Processes” by C.A.R.
Hoare
Node.js: I don’t block
• Relatively easy to write and run
• Awesome V8 engine
• Event loop with promises
• NodeJS is single-threaded.
• It cannot directly use multi-core CPUs even though it is possible to
spawn different processes on several threads.
Node.js single threaded model
Go
• 2009 at Google by Rob Pike, Ken Thompson, Robert Griesemer.
• Primary motivation: Shared dislike of C++
• Slow compile times
• Standard Library offers no real support for Unicode
• Code bloat etc..
• Go is targeted as a modern C and especially as a replacement for C++.
Go
• Rethinks the traditional object-oriented development
• Effectively use all of the cores on your expensive server
• Go has a concise syntax with few keywords to memorize
• Fast complier: compiles to machine code
• Built in concurrency. NO to special threading libraries
Go
• Simple and effective type system
• Garbage collector: don’t have to manage your own memory.
• Spend less time waiting for your project to build
• Looks at the library that you directly include, rather than traversing
the dependencies of all the libraries that are included in the entire
dependency chain like Java, C, and C++.
• Taste: Objected Oriented and Functional Programming
Concurrency
• Concurrency vs Parallelism ?
• Concurrency: Programming as the composition of independently
executing processes.
• Parallelism: Programming as the simultaneous execution of (possibly
related) computations.
• Concurrency is about dealing with lots of things at once.
• Parallelism is about doing lots of things at once.
• Concurrency is about structure, parallelism is about execution.
Go supports concurrency
• Go provides:
• concurrent execution (goroutines)
• synchronization and messaging (channels)
• multi-way concurrent control (select)
• Goroutines come with built-in primitives to communicate safely
between themselves (channels).
• A single goroutine can run on multiple threads. Goroutines are
multiplexed into small number of OS threads.
• Goroutine is very cheap: 2kb vs 1MB(Java)
Objected Oriented Design
• No Inheritance ! No multi Inheritance problem.
• Go developers simply embed types to reuse functionality in a design
pattern called composition
• Interface: Allows you to model behavior
Type System and more
• Short variable declaration operator (:=)
• type interface{}
• Structs
• Anonymous function
• defer: To schedule a function call to be executed right after a function
returns.
Type System and more
• Receiver type for method declarations
• Main() and Init()
• Standard library
• Built in Testing, Benchmarking, Packing, Tooling
Presence
• Google
• Uber
• SoundCloud
• Walmart
• Docker
• Bitly
• BBC
• Basecamp
• DigitalOcean
• StackExchange
• Mozilla
• Lyft
• Blockchain
startups
• Facebook
• Twitter
• YouTube
• Apple
• Dropbox
• Github
• Games like Farmville
• IBM
• CoreOS
• GitLab
• InfluxData
• Intel
• Medium
References:
• https://en.wikipedia.org/wiki/Go_(programming_language)
• https://talks.golang.org
• https://hackernoon.com/why-go-ef8850dc5f3c
• Go in Action by Bill Kennedy
• https://medium.com/exploring-code/why-should-you-learn-go-
f607681fad65
• https://hackernoon.com/golang-or-the-future-of-the-dev-
984c2f145bbe
• https://gist.github.com/ungerik/3731476
THANK YOU

Más contenido relacionado

La actualidad más candente

Cookpad Hackarade #04: Create Your Own Interpreter
Cookpad Hackarade #04: Create Your Own InterpreterCookpad Hackarade #04: Create Your Own Interpreter
Cookpad Hackarade #04: Create Your Own Interpreter
mametter
 
Enjoy Ruby Programming in IDE and TypeProf
Enjoy Ruby Programming in IDE and TypeProfEnjoy Ruby Programming in IDE and TypeProf
Enjoy Ruby Programming in IDE and TypeProf
mametter
 
AppDays Pordenone 2014: Web App Engineering With Dart
AppDays Pordenone 2014: Web App Engineering With DartAppDays Pordenone 2014: Web App Engineering With Dart
AppDays Pordenone 2014: Web App Engineering With Dart
Claudio d'Angelis
 

La actualidad más candente (20)

iOS UI debugging
iOS UI debuggingiOS UI debugging
iOS UI debugging
 
Scala.io
Scala.ioScala.io
Scala.io
 
IDLs
IDLsIDLs
IDLs
 
Bringing Concurrency to Ruby - RubyConf India 2014
Bringing Concurrency to Ruby - RubyConf India 2014Bringing Concurrency to Ruby - RubyConf India 2014
Bringing Concurrency to Ruby - RubyConf India 2014
 
Cookpad Hackarade #04: Create Your Own Interpreter
Cookpad Hackarade #04: Create Your Own InterpreterCookpad Hackarade #04: Create Your Own Interpreter
Cookpad Hackarade #04: Create Your Own Interpreter
 
Ci. Drupal Camp Berlin 2014
Ci. Drupal Camp Berlin 2014Ci. Drupal Camp Berlin 2014
Ci. Drupal Camp Berlin 2014
 
Enjoy Ruby Programming in IDE and TypeProf
Enjoy Ruby Programming in IDE and TypeProfEnjoy Ruby Programming in IDE and TypeProf
Enjoy Ruby Programming in IDE and TypeProf
 
TSSJS 2011 - JRuby
TSSJS 2011 - JRubyTSSJS 2011 - JRuby
TSSJS 2011 - JRuby
 
AppDays Pordenone 2014: Web App Engineering With Dart
AppDays Pordenone 2014: Web App Engineering With DartAppDays Pordenone 2014: Web App Engineering With Dart
AppDays Pordenone 2014: Web App Engineering With Dart
 
An introduction to go programming language
An introduction to go programming languageAn introduction to go programming language
An introduction to go programming language
 
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016
Microsoft Azure DocumentDB -  Global Azure Bootcamp 2016Microsoft Azure DocumentDB -  Global Azure Bootcamp 2016
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016
 
Isomorphic Kotlin
Isomorphic KotlinIsomorphic Kotlin
Isomorphic Kotlin
 
Our wish to Flowtype
Our wish to FlowtypeOur wish to Flowtype
Our wish to Flowtype
 
Introduction to protocol buffer
Introduction to protocol bufferIntroduction to protocol buffer
Introduction to protocol buffer
 
From .NET Core 3, all the rest will be legacy
From .NET Core 3, all the rest will be legacyFrom .NET Core 3, all the rest will be legacy
From .NET Core 3, all the rest will be legacy
 
The Future of Node - @rvagg - NodeConf Christchurch 2015
The Future of Node - @rvagg - NodeConf Christchurch 2015The Future of Node - @rvagg - NodeConf Christchurch 2015
The Future of Node - @rvagg - NodeConf Christchurch 2015
 
A Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and UnderstandingA Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and Understanding
 
Introduction to Kotlin coroutines
Introduction to Kotlin coroutinesIntroduction to Kotlin coroutines
Introduction to Kotlin coroutines
 
A Quick Tour of JVM Languages
A Quick Tour of JVM LanguagesA Quick Tour of JVM Languages
A Quick Tour of JVM Languages
 
How to create/improve OSS products and its community
How to create/improve OSS products and its communityHow to create/improve OSS products and its community
How to create/improve OSS products and its community
 

Similar a Go: What's Different ?

T4T Training day - NodeJS
T4T Training day - NodeJST4T Training day - NodeJS
T4T Training day - NodeJS
Tim Sommer
 

Similar a Go: What's Different ? (20)

Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
Why ruby and rails
Why ruby and railsWhy ruby and rails
Why ruby and rails
 
T4T Training day - NodeJS
T4T Training day - NodeJST4T Training day - NodeJS
T4T Training day - NodeJS
 
Open Source SQL Databases
Open Source SQL DatabasesOpen Source SQL Databases
Open Source SQL Databases
 
Go - A Key Language in Enterprise Application Development?
Go - A Key Language in Enterprise Application Development?Go - A Key Language in Enterprise Application Development?
Go - A Key Language in Enterprise Application Development?
 
Starting from scratch in 2017
Starting from scratch in 2017Starting from scratch in 2017
Starting from scratch in 2017
 
High-Performance Computing with C++
High-Performance Computing with C++High-Performance Computing with C++
High-Performance Computing with C++
 
Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
GoLang - Why It Matters
GoLang -  Why It MattersGoLang -  Why It Matters
GoLang - Why It Matters
 
High Performance Systems in Go - GopherCon 2014
High Performance Systems in Go - GopherCon 2014High Performance Systems in Go - GopherCon 2014
High Performance Systems in Go - GopherCon 2014
 
Monorepo at Pinterest
Monorepo at PinterestMonorepo at Pinterest
Monorepo at Pinterest
 
Clojure in real life 17.10.2014
Clojure in real life 17.10.2014Clojure in real life 17.10.2014
Clojure in real life 17.10.2014
 
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In ActionKotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
 
SSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJSSSJS, NoSQL, GAE and AppengineJS
SSJS, NoSQL, GAE and AppengineJS
 
Kotlin Multiplatfom In Action
Kotlin Multiplatfom In ActionKotlin Multiplatfom In Action
Kotlin Multiplatfom In Action
 
Pulsar
PulsarPulsar
Pulsar
 
Node Architecture.pptx
Node Architecture.pptxNode Architecture.pptx
Node Architecture.pptx
 
cadec-2017-golang
cadec-2017-golangcadec-2017-golang
cadec-2017-golang
 
GWT Jug Stuttgart
GWT Jug StuttgartGWT Jug Stuttgart
GWT Jug Stuttgart
 
APIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidadAPIs distribuidos con alta escalabilidad
APIs distribuidos con alta escalabilidad
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

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
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
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
 
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
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
[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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 

Go: What's Different ?

  • 1. GO: What’s Different ? Tarun Vashisth 28th Sep 2018
  • 2. Contents • Programming Languages • History • Challenges • Concurrency • Object Oriented Design • Type system and more • Presence • References
  • 4. History • 1950’s: Fortran, Lisp, Algol, Cobol • 1960-70’s: B, Pascal, C, Prolog, SQL • 1980’s: C++, Ada, Matlab, Erlang, Perl • 1990’s(Internet age): Haskell, Python, VB, R, Ruby, Java, PHP, JavaScript • 2000’s: ActionScript, C#, D, Groovy, Scala, Clojure, Go, Rust, Kotlin, Swift • CULTURE ?
  • 5. Challenges: Hardware limitations • A fundamental turn towards concurrency in software • Well, 3GHz CPUs -> 2004 and today -> MacBookPro@2.7GHz.
  • 6. Challenges: Hardware limitations • Resort to multicore • Cannot scale indefinitely • Comes with synchronization overhead between the operations. • Increase transistor per unit area on chip?
  • 7. Challenges: Multithreaded design • Traditional programming languages -> 90’s -> traditional single- threaded processes. • Multi-threading • Messy, complicated and expensive. • Significant setup and teardown costs. • We cool ?
  • 8. Challenges: Multithreaded design • Real problem: • Concurrent execution • Threading-locking • Race conditions • Deadlocks. • Go: Designed keeping in mind multiple cores • Famous paper “Communicating Sequential Processes” by C.A.R. Hoare
  • 9. Node.js: I don’t block • Relatively easy to write and run • Awesome V8 engine • Event loop with promises • NodeJS is single-threaded. • It cannot directly use multi-core CPUs even though it is possible to spawn different processes on several threads.
  • 11. Go • 2009 at Google by Rob Pike, Ken Thompson, Robert Griesemer. • Primary motivation: Shared dislike of C++ • Slow compile times • Standard Library offers no real support for Unicode • Code bloat etc.. • Go is targeted as a modern C and especially as a replacement for C++.
  • 12. Go • Rethinks the traditional object-oriented development • Effectively use all of the cores on your expensive server • Go has a concise syntax with few keywords to memorize • Fast complier: compiles to machine code • Built in concurrency. NO to special threading libraries
  • 13.
  • 14. Go • Simple and effective type system • Garbage collector: don’t have to manage your own memory. • Spend less time waiting for your project to build • Looks at the library that you directly include, rather than traversing the dependencies of all the libraries that are included in the entire dependency chain like Java, C, and C++. • Taste: Objected Oriented and Functional Programming
  • 15.
  • 16. Concurrency • Concurrency vs Parallelism ? • Concurrency: Programming as the composition of independently executing processes. • Parallelism: Programming as the simultaneous execution of (possibly related) computations. • Concurrency is about dealing with lots of things at once. • Parallelism is about doing lots of things at once. • Concurrency is about structure, parallelism is about execution.
  • 17.
  • 18. Go supports concurrency • Go provides: • concurrent execution (goroutines) • synchronization and messaging (channels) • multi-way concurrent control (select) • Goroutines come with built-in primitives to communicate safely between themselves (channels). • A single goroutine can run on multiple threads. Goroutines are multiplexed into small number of OS threads. • Goroutine is very cheap: 2kb vs 1MB(Java)
  • 19. Objected Oriented Design • No Inheritance ! No multi Inheritance problem. • Go developers simply embed types to reuse functionality in a design pattern called composition • Interface: Allows you to model behavior
  • 20. Type System and more • Short variable declaration operator (:=) • type interface{} • Structs • Anonymous function • defer: To schedule a function call to be executed right after a function returns.
  • 21. Type System and more • Receiver type for method declarations • Main() and Init() • Standard library • Built in Testing, Benchmarking, Packing, Tooling
  • 22. Presence • Google • Uber • SoundCloud • Walmart • Docker • Bitly • BBC • Basecamp • DigitalOcean • StackExchange • Mozilla • Lyft • Blockchain startups • Facebook • Twitter • YouTube • Apple • Dropbox • Github • Games like Farmville • IBM • CoreOS • GitLab • InfluxData • Intel • Medium
  • 23.
  • 24. References: • https://en.wikipedia.org/wiki/Go_(programming_language) • https://talks.golang.org • https://hackernoon.com/why-go-ef8850dc5f3c • Go in Action by Bill Kennedy • https://medium.com/exploring-code/why-should-you-learn-go- f607681fad65 • https://hackernoon.com/golang-or-the-future-of-the-dev- 984c2f145bbe • https://gist.github.com/ungerik/3731476