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

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
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go langAmal Mohan N
 
Go Programming language, golang
Go Programming language, golangGo Programming language, golang
Go Programming language, golangBasil N G
 
Golang (Go Programming Language)
Golang (Go Programming Language)Golang (Go Programming Language)
Golang (Go Programming Language)ShubhamMishra485
 
Introduction to Go programming language
Introduction to Go programming languageIntroduction to Go programming language
Introduction to Go programming languageSlawomir Dorzak
 
Go Programming Language (Golang)
Go Programming Language (Golang)Go Programming Language (Golang)
Go Programming Language (Golang)Ishin Vin
 
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 Concurrency
Go ConcurrencyGo Concurrency
Go Concurrencyjgrahamc
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golangBo-Yi Wu
 
Golang getting started
Golang getting startedGolang getting started
Golang getting startedHarshad Patil
 
Introduction to go language programming
Introduction to go language programmingIntroduction to go language programming
Introduction to go language programmingMahmoud Masih Tehrani
 
Concurrency in Golang
Concurrency in GolangConcurrency in Golang
Concurrency in GolangOliver N
 

What's hot (20)

Go lang
Go langGo lang
Go lang
 
Golang
GolangGolang
Golang
 
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
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
 
GoLang Introduction
GoLang IntroductionGoLang Introduction
GoLang Introduction
 
Go Programming language, golang
Go Programming language, golangGo Programming language, golang
Go Programming language, golang
 
Golang (Go Programming Language)
Golang (Go Programming Language)Golang (Go Programming Language)
Golang (Go Programming Language)
 
Introduction to Go programming language
Introduction to Go programming languageIntroduction to Go programming language
Introduction to Go programming language
 
Go Programming Language (Golang)
Go Programming Language (Golang)Go Programming Language (Golang)
Go Programming Language (Golang)
 
Concurrency With Go
Concurrency With GoConcurrency With Go
Concurrency With Go
 
Go Lang Tutorial
Go Lang TutorialGo Lang Tutorial
Go Lang Tutorial
 
Golang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / OverviewGolang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / Overview
 
Golang Template
Golang TemplateGolang Template
Golang Template
 
Go Concurrency
Go ConcurrencyGo Concurrency
Go Concurrency
 
Go Language presentation
Go Language presentationGo Language presentation
Go Language presentation
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golang
 
Golang getting started
Golang getting startedGolang getting started
Golang getting started
 
Introduction to go language programming
Introduction to go language programmingIntroduction to go language programming
Introduction to go language programming
 
Golang workshop
Golang workshopGolang workshop
Golang workshop
 
Concurrency in Golang
Concurrency in GolangConcurrency in Golang
Concurrency in Golang
 

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

Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Anthony Dahanne
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 

Recently uploaded (20)

Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024Not a Kubernetes fan? The state of PaaS in 2024
Not a Kubernetes fan? The state of PaaS in 2024
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 

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