SlideShare a Scribd company logo
1 of 13
Download to read offline
ParamiSoft’s
Pragmatic Pandit Talks
Go-programming language
1
Why Go?
No major systems language has emerged in over a decade, but over that time the computing
landscape has changed tremendously. There are several trends:!
! •! Computers are enormously quicker but software development is not faster.!
! •! Dependency management is a big part of software development today but the “header files” of languages
in the C tradition are antithetical to clean dependency analysis—and fast compilation.!
! •! There is a growing rebellion against cumbersome type systems like those of Java and C++, pushing
people towards dynamically typed languages such as Python and JavaScript.!
! •! Some fundamental concepts such as garbage collection and parallel computation are not well supported
by popular systems languages.!
! •! The emergence of multicore computers has generated worry and confusion.!
We believe it's worth trying again with a new language, a concurrent, garbage-collected language with
fast compilation. Regarding the points above:!
! •! It is possible to compile a large Go program in a few seconds on a single computer.!
! •! Go provides a model for software construction that makes dependency analysis easy and avoids much of
the overhead of C-style include files and libraries.!
! •! Go's type system has no hierarchy, so no time is spent defining the relationships between types. Also,
although Go has static types the language attempts to make types feel lighter weight than in typical OO
languages.!
! •! Go is fully garbage-collected and provides fundamental support for concurrent execution and
communication.!
! •! By its design, Go proposes an approach for the construction of system software on multicore machines.!
A much more expansive answer to this question is available in the article, Go at Google: Language
Design in the Service of Software Engineering. 2
Guiding Principles in Design
• reduce the amount of typing in both senses of the word!
• reduce clutter and complexity !
• no forward declarations and no header files; everything is declared exactly once!
• most radically, there is no type hierarchy: types just are, they don't have to
announce their relationships!
• Want more? - Go read FAQs - http://golang.org/doc/faq
3
Whats Go?
• DNA of Go :)
• compiled, statically-typed,imperative, concurrent and structured
language.
• compiled - gc compiler, memory managed by - garbage collection
• statically typed with some dynamically typed capabilities
• imperative - tell computer how to do e.g ruby,
• declarative - tell computer what to do e.g scala
• concurrent - multithreading as well as CPU parallelism.
4
Go by Example :)
• Hello World!
!
package main
!
import "fmt"
!
func main() {
fmt.Println("hello world")
}
5
Go by Example
• package - is like libraries
• fmt - the formatter. No need to format lines :)
6
Go by Example :)
$go run hello-world.go
hello world
!
$ go build hello-world.go
$ ls
hello-world hello-world.go
!
$ ./hello-world
hello world
7
Go by Example :)
• Values
!
package main
!
import "fmt"
!
func main() {
!
//Strings, which can be added together with +.
!
fmt.Println("go" + "lang")
// Integers and floats.
fmt.Println("1+1 =", 1+1)
!
fmt.Println("7.0/3.0 =", 7.0/3.0)
!
// Booleans, with boolean operators as you’d expect.
!
fmt.Println(true && false)
fmt.Println(true || false)
fmt.Println(!true)
}
!
$ go run values.go
golang
1+1 = 2
7.0/3.0 = 2.3333333333333335
false
true
false
8
Go by Example :)
Variables
!
package main
!
import "fmt"
!
func main() {
!
// var declares 1 or more variables.
var a string = "initial"
fmt.Println(a)
!
// You can declare multiple variables at once.
var b, c int = 1, 2
fmt.Println(b, c)
!
//Go will infer the type of initialized variables.
var d = true
fmt.Println(d)
!
//Variables declared without a corresponding initialization are zero-valued. For example, the zero value for an int is 0.
var e int
fmt.Println(e)
!
//The := syntax is shorthand for declaring and initializing a variable, e.g. for var f string = "short" in this case.
!
f := "short"
fmt.Println(f)
}
!
!
$ go run variables.go
initial
1 2
9
Go by Example :)
•Functions
!
!
!
package main
!
import “fmt"
!
// Here’s a function that takes two ints and returns their sum as an int.
!
func plus(a int, b int) int {
!
// Go requires explicit returns, i.e. it won’t automatically return the value of the last expression.
!
return a + b
}
!
func main() {
!
// Call a function just as you’d expect, with name(args).
!
res := plus(1, 2)
fmt.Println("1+2 =", res)
}
!
$ go run functions.go
1+2 = 3
10
Go by Example :)
• Multiple return values
!
package main
!
import "fmt"
!
// The (int, int) in this function signature shows that the function returns 2 ints.
!
func vals() (int, int) {
return 3, 7
}
!
func main() {
!
// Here we use the 2 different return values from the call with multiple assignment.
a, b := vals()
fmt.Println(a)
fmt.Println(b)
!
// If you only want a subset of the returned values, use the blank identifier _.
_, c := vals()
fmt.Println(c)
}
!
$ go run multiple-return-values.go
3
7
7
11
Go - Learn More
https://gobyexample.com/
http://tour.golang.org
http://golang.org/doc/effective_go.html
http://go-lang.cat-v.org
http://www.stanford.edu/class/ee380/Abstracts/
100428.html
12
Go - Thank YourSelf!
13

More Related Content

What's hot

Introduction to GoLang
Introduction to GoLangIntroduction to GoLang
Introduction to GoLangNVISIA
 
The Go programming language - Intro by MyLittleAdventure
The Go programming language - Intro by MyLittleAdventureThe Go programming language - Intro by MyLittleAdventure
The Go programming language - Intro by MyLittleAdventuremylittleadventure
 
Go Programming Language (Golang)
Go Programming Language (Golang)Go Programming Language (Golang)
Go Programming Language (Golang)Ishin Vin
 
Go Programming language, golang
Go Programming language, golangGo Programming language, golang
Go Programming language, golangBasil N G
 
Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageAniruddha Chakrabarti
 
Golang (Go Programming Language)
Golang (Go Programming Language)Golang (Go Programming Language)
Golang (Go Programming Language)ShubhamMishra485
 
Introduction to go language programming
Introduction to go language programmingIntroduction to go language programming
Introduction to go language programmingMahmoud Masih Tehrani
 
Introduction to Go programming language
Introduction to Go programming languageIntroduction to Go programming language
Introduction to Go programming languageSlawomir Dorzak
 
Golang getting started
Golang getting startedGolang getting started
Golang getting startedHarshad Patil
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golangBo-Yi Wu
 
Golang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / OverviewGolang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / OverviewMarkus Schneider
 
Go vs Python Comparison
Go vs Python ComparisonGo vs Python Comparison
Go vs Python ComparisonSimplilearn
 

What's hot (20)

Introduction to GoLang
Introduction to GoLangIntroduction to GoLang
Introduction to GoLang
 
Go lang
Go langGo lang
Go lang
 
The Go programming language - Intro by MyLittleAdventure
The Go programming language - Intro by MyLittleAdventureThe Go programming language - Intro by MyLittleAdventure
The Go programming language - Intro by MyLittleAdventure
 
Golang
GolangGolang
Golang
 
Go Programming Language (Golang)
Go Programming Language (Golang)Go Programming Language (Golang)
Go Programming Language (Golang)
 
Go Programming language, golang
Go Programming language, golangGo Programming language, golang
Go Programming language, golang
 
Golang - Overview of Go (golang) Language
Golang - Overview of Go (golang) LanguageGolang - Overview of Go (golang) Language
Golang - Overview of Go (golang) Language
 
Go Lang Tutorial
Go Lang TutorialGo Lang Tutorial
Go Lang Tutorial
 
GoLang Introduction
GoLang IntroductionGoLang Introduction
GoLang Introduction
 
Golang (Go Programming Language)
Golang (Go Programming Language)Golang (Go Programming Language)
Golang (Go Programming Language)
 
Introduction to go language programming
Introduction to go language programmingIntroduction to go language programming
Introduction to go language programming
 
Introduction to Go programming language
Introduction to Go programming languageIntroduction to Go programming language
Introduction to Go programming language
 
Golang getting started
Golang getting startedGolang getting started
Golang getting started
 
Concurrency With Go
Concurrency With GoConcurrency With Go
Concurrency With Go
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golang
 
Golang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / OverviewGolang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / Overview
 
Go vs Python Comparison
Go vs Python ComparisonGo vs Python Comparison
Go vs Python Comparison
 
Golang workshop
Golang workshopGolang workshop
Golang workshop
 
An introduction to programming in Go
An introduction to programming in GoAn introduction to programming in Go
An introduction to programming in Go
 
Golang Template
Golang TemplateGolang Template
Golang Template
 

Similar to ParamiSoft’s Pragmatic Pandit Talks Go

Introduction to Programming in Go
Introduction to Programming in GoIntroduction to Programming in Go
Introduction to Programming in GoAmr Hassan
 
computer languages
computer languagescomputer languages
computer languagesRajendran
 
Number of Computer Languages = 3
Number of Computer Languages = 3Number of Computer Languages = 3
Number of Computer Languages = 3Ram Sekhar
 
Creating a compiler for your own language
Creating a compiler for your own languageCreating a compiler for your own language
Creating a compiler for your own languageAndrea Tino
 
Let's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming LanguageLet's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming LanguageGanesh Samarthyam
 
Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language Ganesh Samarthyam
 
Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Ganesh Samarthyam
 
A First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageA First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageGanesh Samarthyam
 
Looping and switch cases
Looping and switch casesLooping and switch cases
Looping and switch casesMeoRamos
 
difference between c c++ c#
difference between c c++ c#difference between c c++ c#
difference between c c++ c#Sireesh K
 
AddisDev Meetup ii: Golang and Flow-based Programming
AddisDev Meetup ii: Golang and Flow-based ProgrammingAddisDev Meetup ii: Golang and Flow-based Programming
AddisDev Meetup ii: Golang and Flow-based ProgrammingSamuel Lampa
 
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...Codemotion
 
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...Codemotion
 
(6) cpp numeric representation_exercises
(6) cpp numeric representation_exercises(6) cpp numeric representation_exercises
(6) cpp numeric representation_exercisesNico Ludwig
 

Similar to ParamiSoft’s Pragmatic Pandit Talks Go (20)

Introduction to Programming in Go
Introduction to Programming in GoIntroduction to Programming in Go
Introduction to Programming in Go
 
computer languages
computer languagescomputer languages
computer languages
 
Number of Computer Languages = 3
Number of Computer Languages = 3Number of Computer Languages = 3
Number of Computer Languages = 3
 
Creating a compiler for your own language
Creating a compiler for your own languageCreating a compiler for your own language
Creating a compiler for your own language
 
Go fundamentals
Go fundamentalsGo fundamentals
Go fundamentals
 
Beginning development in go
Beginning development in goBeginning development in go
Beginning development in go
 
Let's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming LanguageLet's Go: Introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming Language
 
Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language Lets Go - An introduction to Google's Go Programming Language
Lets Go - An introduction to Google's Go Programming Language
 
Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction Google's Go Programming Language - Introduction
Google's Go Programming Language - Introduction
 
A First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageA First Look at Google's Go Programming Language
A First Look at Google's Go Programming Language
 
Looping and switch cases
Looping and switch casesLooping and switch cases
Looping and switch cases
 
Switch case looping
Switch case loopingSwitch case looping
Switch case looping
 
C c#
C c#C c#
C c#
 
difference between c c++ c#
difference between c c++ c#difference between c c++ c#
difference between c c++ c#
 
AddisDev Meetup ii: Golang and Flow-based Programming
AddisDev Meetup ii: Golang and Flow-based ProgrammingAddisDev Meetup ii: Golang and Flow-based Programming
AddisDev Meetup ii: Golang and Flow-based Programming
 
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
 
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
 
(6) cpp numeric representation_exercises
(6) cpp numeric representation_exercises(6) cpp numeric representation_exercises
(6) cpp numeric representation_exercises
 
Go programing language
Go programing languageGo programing language
Go programing language
 
PCEP Module 1.pptx
PCEP Module 1.pptxPCEP Module 1.pptx
PCEP Module 1.pptx
 

More from paramisoft

Ruby on Rails Introduction
Ruby on Rails IntroductionRuby on Rails Introduction
Ruby on Rails Introductionparamisoft
 
Introduction To Backbone JS
Introduction To Backbone JSIntroduction To Backbone JS
Introduction To Backbone JSparamisoft
 
Git essentials
Git essentials Git essentials
Git essentials paramisoft
 
iOS development introduction
iOS development introduction iOS development introduction
iOS development introduction paramisoft
 
Introduction to HAML
Introduction to  HAML Introduction to  HAML
Introduction to HAML paramisoft
 
Desing pattern prototype-Factory Method, Prototype and Builder
Desing pattern prototype-Factory Method, Prototype and Builder Desing pattern prototype-Factory Method, Prototype and Builder
Desing pattern prototype-Factory Method, Prototype and Builder paramisoft
 
Design pattern (Abstract Factory & Singleton)
Design pattern (Abstract Factory & Singleton)Design pattern (Abstract Factory & Singleton)
Design pattern (Abstract Factory & Singleton)paramisoft
 
ParamiSoft Systems Pvt. Ltd. Profile
ParamiSoft Systems Pvt. Ltd. ProfileParamiSoft Systems Pvt. Ltd. Profile
ParamiSoft Systems Pvt. Ltd. Profileparamisoft
 
Garden City Ruby Conference - lightening talk
Garden City Ruby Conference - lightening talkGarden City Ruby Conference - lightening talk
Garden City Ruby Conference - lightening talkparamisoft
 

More from paramisoft (9)

Ruby on Rails Introduction
Ruby on Rails IntroductionRuby on Rails Introduction
Ruby on Rails Introduction
 
Introduction To Backbone JS
Introduction To Backbone JSIntroduction To Backbone JS
Introduction To Backbone JS
 
Git essentials
Git essentials Git essentials
Git essentials
 
iOS development introduction
iOS development introduction iOS development introduction
iOS development introduction
 
Introduction to HAML
Introduction to  HAML Introduction to  HAML
Introduction to HAML
 
Desing pattern prototype-Factory Method, Prototype and Builder
Desing pattern prototype-Factory Method, Prototype and Builder Desing pattern prototype-Factory Method, Prototype and Builder
Desing pattern prototype-Factory Method, Prototype and Builder
 
Design pattern (Abstract Factory & Singleton)
Design pattern (Abstract Factory & Singleton)Design pattern (Abstract Factory & Singleton)
Design pattern (Abstract Factory & Singleton)
 
ParamiSoft Systems Pvt. Ltd. Profile
ParamiSoft Systems Pvt. Ltd. ProfileParamiSoft Systems Pvt. Ltd. Profile
ParamiSoft Systems Pvt. Ltd. Profile
 
Garden City Ruby Conference - lightening talk
Garden City Ruby Conference - lightening talkGarden City Ruby Conference - lightening talk
Garden City Ruby Conference - lightening talk
 

Recently uploaded

ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutionsmonugehlot87
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?Watsoo Telematics
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 

Recently uploaded (20)

ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutions
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 

ParamiSoft’s Pragmatic Pandit Talks Go

  • 2. Why Go? No major systems language has emerged in over a decade, but over that time the computing landscape has changed tremendously. There are several trends:! ! •! Computers are enormously quicker but software development is not faster.! ! •! Dependency management is a big part of software development today but the “header files” of languages in the C tradition are antithetical to clean dependency analysis—and fast compilation.! ! •! There is a growing rebellion against cumbersome type systems like those of Java and C++, pushing people towards dynamically typed languages such as Python and JavaScript.! ! •! Some fundamental concepts such as garbage collection and parallel computation are not well supported by popular systems languages.! ! •! The emergence of multicore computers has generated worry and confusion.! We believe it's worth trying again with a new language, a concurrent, garbage-collected language with fast compilation. Regarding the points above:! ! •! It is possible to compile a large Go program in a few seconds on a single computer.! ! •! Go provides a model for software construction that makes dependency analysis easy and avoids much of the overhead of C-style include files and libraries.! ! •! Go's type system has no hierarchy, so no time is spent defining the relationships between types. Also, although Go has static types the language attempts to make types feel lighter weight than in typical OO languages.! ! •! Go is fully garbage-collected and provides fundamental support for concurrent execution and communication.! ! •! By its design, Go proposes an approach for the construction of system software on multicore machines.! A much more expansive answer to this question is available in the article, Go at Google: Language Design in the Service of Software Engineering. 2
  • 3. Guiding Principles in Design • reduce the amount of typing in both senses of the word! • reduce clutter and complexity ! • no forward declarations and no header files; everything is declared exactly once! • most radically, there is no type hierarchy: types just are, they don't have to announce their relationships! • Want more? - Go read FAQs - http://golang.org/doc/faq 3
  • 4. Whats Go? • DNA of Go :) • compiled, statically-typed,imperative, concurrent and structured language. • compiled - gc compiler, memory managed by - garbage collection • statically typed with some dynamically typed capabilities • imperative - tell computer how to do e.g ruby, • declarative - tell computer what to do e.g scala • concurrent - multithreading as well as CPU parallelism. 4
  • 5. Go by Example :) • Hello World! ! package main ! import "fmt" ! func main() { fmt.Println("hello world") } 5
  • 6. Go by Example • package - is like libraries • fmt - the formatter. No need to format lines :) 6
  • 7. Go by Example :) $go run hello-world.go hello world ! $ go build hello-world.go $ ls hello-world hello-world.go ! $ ./hello-world hello world 7
  • 8. Go by Example :) • Values ! package main ! import "fmt" ! func main() { ! //Strings, which can be added together with +. ! fmt.Println("go" + "lang") // Integers and floats. fmt.Println("1+1 =", 1+1) ! fmt.Println("7.0/3.0 =", 7.0/3.0) ! // Booleans, with boolean operators as you’d expect. ! fmt.Println(true && false) fmt.Println(true || false) fmt.Println(!true) } ! $ go run values.go golang 1+1 = 2 7.0/3.0 = 2.3333333333333335 false true false 8
  • 9. Go by Example :) Variables ! package main ! import "fmt" ! func main() { ! // var declares 1 or more variables. var a string = "initial" fmt.Println(a) ! // You can declare multiple variables at once. var b, c int = 1, 2 fmt.Println(b, c) ! //Go will infer the type of initialized variables. var d = true fmt.Println(d) ! //Variables declared without a corresponding initialization are zero-valued. For example, the zero value for an int is 0. var e int fmt.Println(e) ! //The := syntax is shorthand for declaring and initializing a variable, e.g. for var f string = "short" in this case. ! f := "short" fmt.Println(f) } ! ! $ go run variables.go initial 1 2 9
  • 10. Go by Example :) •Functions ! ! ! package main ! import “fmt" ! // Here’s a function that takes two ints and returns their sum as an int. ! func plus(a int, b int) int { ! // Go requires explicit returns, i.e. it won’t automatically return the value of the last expression. ! return a + b } ! func main() { ! // Call a function just as you’d expect, with name(args). ! res := plus(1, 2) fmt.Println("1+2 =", res) } ! $ go run functions.go 1+2 = 3 10
  • 11. Go by Example :) • Multiple return values ! package main ! import "fmt" ! // The (int, int) in this function signature shows that the function returns 2 ints. ! func vals() (int, int) { return 3, 7 } ! func main() { ! // Here we use the 2 different return values from the call with multiple assignment. a, b := vals() fmt.Println(a) fmt.Println(b) ! // If you only want a subset of the returned values, use the blank identifier _. _, c := vals() fmt.Println(c) } ! $ go run multiple-return-values.go 3 7 7 11
  • 12. Go - Learn More https://gobyexample.com/ http://tour.golang.org http://golang.org/doc/effective_go.html http://go-lang.cat-v.org http://www.stanford.edu/class/ee380/Abstracts/ 100428.html 12
  • 13. Go - Thank YourSelf! 13