SlideShare a Scribd company logo
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 ïŹles” 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 ïŹles and libraries.!
! ‱! Go's type system has no hierarchy, so no time is spent deïŹning 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 ïŹles; 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

PPTX
Introduction to go lang
PDF
Golang
PPTX
Golang (Go Programming Language)
PPTX
Go. Why it goes
PDF
Golang 101
PPTX
Go Language presentation
PDF
Go Programming Language by Google
Introduction to go lang
Golang
Golang (Go Programming Language)
Go. Why it goes
Golang 101
Go Language presentation
Go Programming Language by Google

What's hot (20)

PDF
Coding with golang
PDF
Go lang
PDF
Why you should care about Go (Golang)
PDF
Go Lang Tutorial
PPTX
Go Programming language, golang
PDF
Introduction to Go programming language
PPTX
Golang - Overview of Go (golang) Language
PDF
The Go programming language - Intro by MyLittleAdventure
PDF
GoLang Introduction
PPTX
Go Programming Language (Golang)
PDF
Golang workshop
PDF
An introduction to programming in Go
PDF
Golang and Eco-System Introduction / Overview
PPT
Groovy presentation
PPTX
Gradle
PDF
Introduction to go language programming
PPT
Introduction to Go programming
 
PDF
Loom Virtual Threads in the JDK 19
PDF
Golang
PDF
Gitlab ci, cncf.sk
Coding with golang
Go lang
Why you should care about Go (Golang)
Go Lang Tutorial
Go Programming language, golang
Introduction to Go programming language
Golang - Overview of Go (golang) Language
The Go programming language - Intro by MyLittleAdventure
GoLang Introduction
Go Programming Language (Golang)
Golang workshop
An introduction to programming in Go
Golang and Eco-System Introduction / Overview
Groovy presentation
Gradle
Introduction to go language programming
Introduction to Go programming
 
Loom Virtual Threads in the JDK 19
Golang
Gitlab ci, cncf.sk
Ad

Similar to Go language presentation (20)

PDF
Introduction to Programming in Go
PPT
computer languages
PDF
Number of Computer Languages = 3
PDF
Creating a compiler for your own language
PPTX
Go fundamentals
PPTX
Lab1GoBasicswithgo_foundationofgolang.pptx
PDF
Beginning development in go
PDF
computer science cousre related to python
PPT
Introduction to Go ProgrammingLanguage.ppt
PPTX
Lecture 1 Introduction.pptx hfjsh huwhf uwej wiuehfi w
PDF
Lets Go - An introduction to Google's Go Programming Language
PDF
Let's Go: Introduction to Google's Go Programming Language
PPT
A First Look at Google's Go Programming Language
PPT
Google's Go Programming Language - Introduction
PPTX
Looping and switch cases
PPTX
Switch case looping
PPTX
C c#
PPTX
difference between c c++ c#
PDF
AddisDev Meetup ii: Golang and Flow-based Programming
PDF
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Introduction to Programming in Go
computer languages
Number of Computer Languages = 3
Creating a compiler for your own language
Go fundamentals
Lab1GoBasicswithgo_foundationofgolang.pptx
Beginning development in go
computer science cousre related to python
Introduction to Go ProgrammingLanguage.ppt
Lecture 1 Introduction.pptx hfjsh huwhf uwej wiuehfi w
Lets Go - An introduction to Google's Go Programming Language
Let's Go: Introduction to Google's Go Programming Language
A First Look at Google's Go Programming Language
Google's Go Programming Language - Introduction
Looping and switch cases
Switch case looping
C c#
difference between c c++ c#
AddisDev Meetup ii: Golang and Flow-based Programming
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Ad

More from paramisoft (9)

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

Recently uploaded (20)

PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Transform Your Business with a Software ERP System
PDF
top salesforce developer skills in 2025.pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
 
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
ManageIQ - Sprint 268 Review - Slide Deck
Design an Analysis of Algorithms II-SECS-1021-03
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Transform Your Business with a Software ERP System
top salesforce developer skills in 2025.pdf
Odoo POS Development Services by CandidRoot Solutions
Understanding Forklifts - TECH EHS Solution
Softaken Excel to vCard Converter Software.pdf
How to Migrate SBCGlobal Email to Yahoo Easily
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
CHAPTER 2 - PM Management and IT Context
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Odoo Companies in India – Driving Business Transformation.pdf
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
 
Upgrade and Innovation Strategies for SAP ERP Customers
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
ISO 45001 Occupational Health and Safety Management System
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus

Go language presentation

  • 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 ïŹles” 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 ïŹles and libraries.! ! ‱! Go's type system has no hierarchy, so no time is spent deïŹning 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 ïŹles; 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