SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Google’s Go
Introduction to the next “C” language!
S G Ganesh
Agenda
 Introduction to Go (What is “Go”?)
 “Hello world” in Go
 Examples for “getting a hang of” Go
 Examples using some novel features
 Implementation status
 Resources
 Let’s Go!
First things first: Setting the stage
 It’s not possible to cover all details of a new language in a
45-mins presentation
 We’ll quickly cover most important aspects of Go
 Can’t drink ocean in a day – let alone in an hour!
 No one is an “expert” in Go yet
 Creators of the language are the only experts right now
 I am an early adopter and got hooked-on to the
language
 I am making this presentation based on my experience
 For many questions, there are no right or wrong answers:
 Go is still an evolving language and answers might
change!
So, what’s all the buzz about?
 Go: new programming language announced by Google (Sep 09)
 Created lots of excitement in the programming community
 Many tout it as the next C language
 ‘C’ evolved from ‘B’; many languages are named as ‘D’, or
want to be the ‘D’ language
 But nothing has made the cut so far; “Go” might (or will it be
“Gone” in a few years ;-) )
 Is there substance behind hype?
 Yes, a lot! Most system programmers find it very good
 Go won Tiobe’s ‘language of the year award 2009’
 Tiobe is a programming language popularity index:
http://www.tiobe.com/
 Latest status (march 2010)
Okay, so what’s Go?
 Go is a new, experimental, concurrent, garbage-collected,
systems-programming language.
 New & Experimental: Go is still at experimental stage
 with tools, packages etc. still in development.
 No production system implemented using Go till now
 Concurrent: Supports 'communication channels’ for
concurrency - Communicating Sequential Processes (CSP).
 Garbage-collected: The memory is automatically garbage
collected
 For systems-programming: Intended for writing things like
compilers, web servers…

Still, we can use it as a general purpose language.
Who’s behind Go?
 Robert Griesemer, Ken Thompson (of Unix
fame), and Rob Pike are the creators of the
language.
 All three are well-known in programming community
 This is how things fell in place:
 Go project was started around May 2007. Ken Thompson
wrote a Go compiler and runtime from scratch.
 By mid of 2008, working compiler and runtime was ready.
 Ian Lance Taylor and Russ Cox joined Go team in 2008. Ian
Taylor implemented GCC front-end for Go.
Why a new language?
 This description is as given by the creators
 No major sys. programming language came-up in last
decade. But much has changed during the last decade(s)
 Libraries becoming bigger with lots of dependencies
 Internet and networking is becoming pervasive
 Client/server systems, massive clusters used today
 Multi-core processors becoming mainstream.
 Systems programming languages were not designed with
these in mind.
 Other reasons
 construction (enterprise software) has become very slow
 OOP using inheritance hierarchies not effective
Goals of the language
 Efficiency and ease of use:
 Efficiency of C, but ease like Ruby.
 Performance: within 10%-20% of equivalent C
 Safe to use:
 Both type-safe as well as memory-safe.
 Concurrency:
 Good support for concurrency and communication
 Garbage Collected:
 "Attempts" to build an efficient, and latency-free Garbage
Collection mechanism.
 High-speed builds:
 Fast compilation & linking
Some important capabilities of Go
 Simplicity: GO has a clean and concise syntax
 Characteristic of Google products
 For example, light-weight type system
 Use it to believe it
 Separation of interface and the implementation
 I know it’s often misused statement, but Go has it!
 Arguably a novel feature of Go
 Goroutines
 Is based on CSP: much safer than lock-based, like Java
 And more:
 E.g. Reflection (yes! but this is systems prog. lang!)
Enough theory, lets see examples!
 All programs in Go should be in a package, its “main”
here
 We import “fmt” package for using Printf function
 Execution starts with ‘main.main()’ function
 Functions have “func” keyword
 Printf is in fmt package
Now we’ll find factorial of a number
 Lack of declarations
 “fact” and “i” inferred as “ints” from init value 1 because of :=
 “for” loop is the only loop construct supported in Go
 Others like “while” are variations of “for”
 An example of minimal features
 Note the lack of semi-colons
 Have to use only if “necessary”
Looks like C, but not C!
 Go has elegant declaration syntax
 See how arguments are passed and returned
 Not like C: it is infamous for its declaration syntax
 Can return multiple values from functions
 See swap for similar functionality in = operator
 Example for “orthogonal” language features
Built-in support for features like maps
 Maps are built-in, so no need to import
 Initialized with pair separated by “:”
 “range” keyword is useful for traversal
 Using a for loop
 Works for slices, strings etc. (“orthogonal” feature)
Functions as first class objects
 Functions are first
class objects in Go
 We can have
“function literals”
(similar to
“closures” in
functional
languages) for
example
Structures
 Structs are declared with type keyword
 We can have struct literals
 Created in heap
 And print struct members using %v in Printf
Methods
 Methods are implemented by specifying the struct
name before the method name
Interfaces: A novel feature
 Interfaces specified with
‘interface’ keyword
 Not same as in C#/Java
 The structs doesn’t have to
say it implements an
interface
 Any struct that implements
the methods as specified
by any interface satisfies
that interface
 Strict static type checking &
“duck typing”!
Goroutines: easy & safe multithreading
 Goroutines are functions executing in parallel
 in the same address space in stack
 They communicate using “channels” (based on CSP)
 Cleaner, simpler and less-bug prone than using locks
 This shows an example* of how a Sort on big list can be done in
parallel with some other computation
We haven’t covered a lot!
 Important features not covered because of limited time
 reflection, embedding structs (aka inheritance), package
construction etc.
 Lots of libraries already implemented
 math, crypto, networking, regex, OS, testing, html gen….
 Garbage collection & Go runtime capabilities
 Currently mark-and-sweep collector, but better ones under
construction
 Small runtime: GC, channels, stack allocation, goroutines
etc.
Implementation status
 Currently compiler tool-chain available for Mac & Linux
 No “official” windows port; “unofficial” old ports exist
 Compilers: GCC implementation and a stand-alone implementation
 You can download the compilers/tools from this website & try it
 It’s open source (BSD license): We can contribute!
 Lots of work going on in libraries and improving the existing
tool chain
 Frequent builds & releases, quick response times etc.
 Many features & tools still lacking in Go
 For example, generics and debugger tool
Resources
 Go websites:
 Official: www.golang.org (web server implemented in Go!)
 Unofficial: http://go-lang.cat-v.org/
 Want to learn Go?
 No “books” yet
 Read "Effective Go” (http://golang.org/doc/effective_go.html)
 tutorials available online
 Tech talk (http://www.youtube.com/watch?v=rKnDgT73v8s)
 Join go-nuts mailing list gonuts@googlegroups.com
 You can try (compile & run) Go programs online!
 This is really useful: http://ideone.com/
Q & A time
So what are you waiting for?
 Lets Go!

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to Go programming
Introduction to Go programmingIntroduction to Go programming
Introduction to Go programmingExotel
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go langAmal Mohan N
 
Golang (Go Programming Language)
Golang (Go Programming Language)Golang (Go Programming Language)
Golang (Go Programming Language)ShubhamMishra485
 
Go Programming language, golang
Go Programming language, golangGo Programming language, golang
Go Programming language, golangBasil N G
 
Golang 101
Golang 101Golang 101
Golang 101宇 傅
 
C++ TRAINING IN AMBALA CANTT! BATRA COMPUTER CENTER
C++ TRAINING IN AMBALA CANTT! BATRA COMPUTER CENTERC++ TRAINING IN AMBALA CANTT! BATRA COMPUTER CENTER
C++ TRAINING IN AMBALA CANTT! BATRA COMPUTER CENTERgroversimrans
 
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
 
Evolution or stagnation programming languages
Evolution or stagnation programming languagesEvolution or stagnation programming languages
Evolution or stagnation programming languagesDaniele Esposti
 
Python Intro For Managers
Python Intro For ManagersPython Intro For Managers
Python Intro For ManagersAtul Shridhar
 
Mphasis Digital - Use Go (gloang) for system programming, distributed systems...
Mphasis Digital - Use Go (gloang) for system programming, distributed systems...Mphasis Digital - Use Go (gloang) for system programming, distributed systems...
Mphasis Digital - Use Go (gloang) for system programming, distributed systems...Aniruddha Chakrabarti
 
Computer Programming Overview
Computer Programming OverviewComputer Programming Overview
Computer Programming Overviewagorolabs
 

Was ist angesagt? (20)

Introduction to Go programming
Introduction to Go programmingIntroduction to Go programming
Introduction to Go programming
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
 
Go Language presentation
Go Language presentationGo Language presentation
Go Language presentation
 
Difference between c, c++ and java
Difference between c, c++ and javaDifference between c, c++ and java
Difference between c, c++ and java
 
Go Lang
Go LangGo Lang
Go Lang
 
Go programing language
Go programing languageGo programing language
Go programing language
 
Golang (Go Programming Language)
Golang (Go Programming Language)Golang (Go Programming Language)
Golang (Go Programming Language)
 
Go Programming language, golang
Go Programming language, golangGo Programming language, golang
Go Programming language, golang
 
Golang 101
Golang 101Golang 101
Golang 101
 
C++ TRAINING IN AMBALA CANTT! BATRA COMPUTER CENTER
C++ TRAINING IN AMBALA CANTT! BATRA COMPUTER CENTERC++ TRAINING IN AMBALA CANTT! BATRA COMPUTER CENTER
C++ TRAINING IN AMBALA CANTT! BATRA COMPUTER CENTER
 
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 ...
 
Go lang
Go langGo lang
Go lang
 
Evolution or stagnation programming languages
Evolution or stagnation programming languagesEvolution or stagnation programming languages
Evolution or stagnation programming languages
 
Python Intro For Managers
Python Intro For ManagersPython Intro For Managers
Python Intro For Managers
 
Mphasis Digital - Use Go (gloang) for system programming, distributed systems...
Mphasis Digital - Use Go (gloang) for system programming, distributed systems...Mphasis Digital - Use Go (gloang) for system programming, distributed systems...
Mphasis Digital - Use Go (gloang) for system programming, distributed systems...
 
Golang introduction
Golang introductionGolang introduction
Golang introduction
 
Dart
DartDart
Dart
 
Computer Programming Overview
Computer Programming OverviewComputer Programming Overview
Computer Programming Overview
 
An Introduction to Go
An Introduction to GoAn Introduction to Go
An Introduction to Go
 

Andere mochten auch

Happy Go Programming
Happy Go ProgrammingHappy Go Programming
Happy Go ProgrammingLin Yo-An
 
Happy Go Programming Part 1
Happy Go Programming Part 1Happy Go Programming Part 1
Happy Go Programming Part 1Lin Yo-An
 
CODA Project- Manisha Arora
CODA Project- Manisha AroraCODA Project- Manisha Arora
CODA Project- Manisha AroraManisha Arora
 
CS 9000 3D presentation
CS 9000 3D presentationCS 9000 3D presentation
CS 9000 3D presentation360 Visualise
 
新しいOpenShiftのしくみを調べてみた
新しいOpenShiftのしくみを調べてみた新しいOpenShiftのしくみを調べてみた
新しいOpenShiftのしくみを調べてみたKazuto Kusama
 
3D Internet Report
3D Internet Report3D Internet Report
3D Internet Reportmaham4569
 
Scala at HUJI PL Seminar 2008
Scala at HUJI PL Seminar 2008Scala at HUJI PL Seminar 2008
Scala at HUJI PL Seminar 2008Yardena Meymann
 
3D IC TECHNOLOGY
3D IC TECHNOLOGY3D IC TECHNOLOGY
3D IC TECHNOLOGYVinil Patel
 
KubernetesとOpenShiftの話
KubernetesとOpenShiftの話KubernetesとOpenShiftの話
KubernetesとOpenShiftの話Kazuto Kusama
 
Blue brain seminar report
Blue brain seminar reportBlue brain seminar report
Blue brain seminar reportSuryoday Nth
 
light tree documentation by pradeep
light tree documentation by pradeeplight tree documentation by pradeep
light tree documentation by pradeepPradeep Kumar
 
[Golang] Go言語でサービス作ってる話
[Golang] Go言語でサービス作ってる話[Golang] Go言語でサービス作ってる話
[Golang] Go言語でサービス作ってる話株式会社YEBIS.XYZ
 
Go言語によるwebアプリの作り方
Go言語によるwebアプリの作り方Go言語によるwebアプリの作り方
Go言語によるwebアプリの作り方Yasutaka Kawamoto
 
3D IC Presented by Tripti Kumari, School of Engineering, CUSAT
3D IC Presented by Tripti Kumari, School of Engineering, CUSAT3D IC Presented by Tripti Kumari, School of Engineering, CUSAT
3D IC Presented by Tripti Kumari, School of Engineering, CUSATthevijayps
 
Scala : language of the future
Scala : language of the futureScala : language of the future
Scala : language of the futureAnsviaLab
 

Andere mochten auch (20)

Happy Go Programming
Happy Go ProgrammingHappy Go Programming
Happy Go Programming
 
An introduction to programming in Go
An introduction to programming in GoAn introduction to programming in Go
An introduction to programming in Go
 
Happy Go Programming Part 1
Happy Go Programming Part 1Happy Go Programming Part 1
Happy Go Programming Part 1
 
CODA Project- Manisha Arora
CODA Project- Manisha AroraCODA Project- Manisha Arora
CODA Project- Manisha Arora
 
Scala introduction
Scala introductionScala introduction
Scala introduction
 
CS 9000 3D presentation
CS 9000 3D presentationCS 9000 3D presentation
CS 9000 3D presentation
 
Go1
Go1Go1
Go1
 
新しいOpenShiftのしくみを調べてみた
新しいOpenShiftのしくみを調べてみた新しいOpenShiftのしくみを調べてみた
新しいOpenShiftのしくみを調べてみた
 
3D Internet Report
3D Internet Report3D Internet Report
3D Internet Report
 
Scala at HUJI PL Seminar 2008
Scala at HUJI PL Seminar 2008Scala at HUJI PL Seminar 2008
Scala at HUJI PL Seminar 2008
 
3D IC TECHNOLOGY
3D IC TECHNOLOGY3D IC TECHNOLOGY
3D IC TECHNOLOGY
 
KubernetesとOpenShiftの話
KubernetesとOpenShiftの話KubernetesとOpenShiftの話
KubernetesとOpenShiftの話
 
Blue brain seminar report
Blue brain seminar reportBlue brain seminar report
Blue brain seminar report
 
3 d internet report
3 d internet report3 d internet report
3 d internet report
 
light tree documentation by pradeep
light tree documentation by pradeeplight tree documentation by pradeep
light tree documentation by pradeep
 
[Golang] Go言語でサービス作ってる話
[Golang] Go言語でサービス作ってる話[Golang] Go言語でサービス作ってる話
[Golang] Go言語でサービス作ってる話
 
Go言語によるwebアプリの作り方
Go言語によるwebアプリの作り方Go言語によるwebアプリの作り方
Go言語によるwebアプリの作り方
 
3D IC Presented by Tripti Kumari, School of Engineering, CUSAT
3D IC Presented by Tripti Kumari, School of Engineering, CUSAT3D IC Presented by Tripti Kumari, School of Engineering, CUSAT
3D IC Presented by Tripti Kumari, School of Engineering, CUSAT
 
Light tree
Light treeLight tree
Light tree
 
Scala : language of the future
Scala : language of the futureScala : language of the future
Scala : language of the future
 

Ähnlich wie Google's Go Programming Language - Introduction

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
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to GoSimon Hewitt
 
Scaling applications with go
Scaling applications with goScaling applications with go
Scaling applications with goVimlesh Sharma
 
difference between c c++ c#
difference between c c++ c#difference between c c++ c#
difference between c c++ c#Sireesh K
 
The Ring programming language version 1.10 book - Part 99 of 212
The Ring programming language version 1.10 book - Part 99 of 212The Ring programming language version 1.10 book - Part 99 of 212
The Ring programming language version 1.10 book - Part 99 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.2 book - Part 4 of 84The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.2 book - Part 4 of 84Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 4 of 180
The Ring programming language version 1.5.1 book - Part 4 of 180The Ring programming language version 1.5.1 book - Part 4 of 180
The Ring programming language version 1.5.1 book - Part 4 of 180Mahmoud Samir Fayed
 
Go Within Cloud Foundry
Go Within Cloud FoundryGo Within Cloud Foundry
Go Within Cloud FoundryPlatform CF
 
The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.6 book - Part 6 of 189The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.6 book - Part 6 of 189Mahmoud Samir Fayed
 
Golang : A Hype or the Future?
Golang : A Hype or the Future?Golang : A Hype or the Future?
Golang : A Hype or the Future?Mindfire LLC
 
Advantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworksAdvantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworksKaty Slemon
 
Beyond the Hype: 4 Years of Go in Production
Beyond the Hype: 4 Years of Go in ProductionBeyond the Hype: 4 Years of Go in Production
Beyond the Hype: 4 Years of Go in ProductionC4Media
 
The Ring programming language version 1.3 book - Part 81 of 88
The Ring programming language version 1.3 book - Part 81 of 88The Ring programming language version 1.3 book - Part 81 of 88
The Ring programming language version 1.3 book - Part 81 of 88Mahmoud Samir Fayed
 
Golang, Future of Programming Language.
Golang, Future of Programming Language.Golang, Future of Programming Language.
Golang, Future of Programming Language.Sunil Yadav
 
The Ring programming language version 1.8 book - Part 6 of 202
The Ring programming language version 1.8 book - Part 6 of 202The Ring programming language version 1.8 book - Part 6 of 202
The Ring programming language version 1.8 book - Part 6 of 202Mahmoud Samir Fayed
 

Ähnlich wie Google's Go Programming Language - Introduction (20)

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
 
Beginning development in go
Beginning development in goBeginning development in go
Beginning development in go
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
Scaling applications with go
Scaling applications with goScaling applications with go
Scaling applications with go
 
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#
 
The Ring programming language version 1.10 book - Part 99 of 212
The Ring programming language version 1.10 book - Part 99 of 212The Ring programming language version 1.10 book - Part 99 of 212
The Ring programming language version 1.10 book - Part 99 of 212
 
The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.2 book - Part 4 of 84The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.2 book - Part 4 of 84
 
The Ring programming language version 1.5.1 book - Part 4 of 180
The Ring programming language version 1.5.1 book - Part 4 of 180The Ring programming language version 1.5.1 book - Part 4 of 180
The Ring programming language version 1.5.1 book - Part 4 of 180
 
Go Within Cloud Foundry
Go Within Cloud FoundryGo Within Cloud Foundry
Go Within Cloud Foundry
 
Google GO
Google GOGoogle GO
Google GO
 
The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.6 book - Part 6 of 189The Ring programming language version 1.6 book - Part 6 of 189
The Ring programming language version 1.6 book - Part 6 of 189
 
Golang : A Hype or the Future?
Golang : A Hype or the Future?Golang : A Hype or the Future?
Golang : A Hype or the Future?
 
Advantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworksAdvantages of golang development services & 10 most used go frameworks
Advantages of golang development services & 10 most used go frameworks
 
Golang
GolangGolang
Golang
 
Beyond the Hype: 4 Years of Go in Production
Beyond the Hype: 4 Years of Go in ProductionBeyond the Hype: 4 Years of Go in Production
Beyond the Hype: 4 Years of Go in Production
 
The Ring programming language version 1.3 book - Part 81 of 88
The Ring programming language version 1.3 book - Part 81 of 88The Ring programming language version 1.3 book - Part 81 of 88
The Ring programming language version 1.3 book - Part 81 of 88
 
Golang, Future of Programming Language.
Golang, Future of Programming Language.Golang, Future of Programming Language.
Golang, Future of Programming Language.
 
The Ring programming language version 1.8 book - Part 6 of 202
The Ring programming language version 1.8 book - Part 6 of 202The Ring programming language version 1.8 book - Part 6 of 202
The Ring programming language version 1.8 book - Part 6 of 202
 
Intermediate Languages
Intermediate LanguagesIntermediate Languages
Intermediate Languages
 

Mehr von Ganesh Samarthyam

Applying Refactoring Tools in Practice
Applying Refactoring Tools in PracticeApplying Refactoring Tools in Practice
Applying Refactoring Tools in PracticeGanesh Samarthyam
 
CFP - 1st Workshop on “AI Meets Blockchain”
CFP - 1st Workshop on “AI Meets Blockchain”CFP - 1st Workshop on “AI Meets Blockchain”
CFP - 1st Workshop on “AI Meets Blockchain”Ganesh Samarthyam
 
Great Coding Skills Aren't Enough
Great Coding Skills Aren't EnoughGreat Coding Skills Aren't Enough
Great Coding Skills Aren't EnoughGanesh Samarthyam
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionGanesh Samarthyam
 
Coding Guidelines - Crafting Clean Code
Coding Guidelines - Crafting Clean CodeCoding Guidelines - Crafting Clean Code
Coding Guidelines - Crafting Clean CodeGanesh Samarthyam
 
Design Patterns - Compiler Case Study - Hands-on Examples
Design Patterns - Compiler Case Study - Hands-on ExamplesDesign Patterns - Compiler Case Study - Hands-on Examples
Design Patterns - Compiler Case Study - Hands-on ExamplesGanesh Samarthyam
 
Bangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Brief PresentationBangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Brief PresentationGanesh Samarthyam
 
Bangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - PosterBangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - PosterGanesh Samarthyam
 
Software Design in Practice (with Java examples)
Software Design in Practice (with Java examples)Software Design in Practice (with Java examples)
Software Design in Practice (with Java examples)Ganesh Samarthyam
 
OO Design and Design Patterns in C++
OO Design and Design Patterns in C++ OO Design and Design Patterns in C++
OO Design and Design Patterns in C++ Ganesh Samarthyam
 
Bangalore Container Conference 2017 - Sponsorship Deck
Bangalore Container Conference 2017 - Sponsorship DeckBangalore Container Conference 2017 - Sponsorship Deck
Bangalore Container Conference 2017 - Sponsorship DeckGanesh Samarthyam
 
Java Generics - Quiz Questions
Java Generics - Quiz QuestionsJava Generics - Quiz Questions
Java Generics - Quiz QuestionsGanesh Samarthyam
 
Software Architecture - Quiz Questions
Software Architecture - Quiz QuestionsSoftware Architecture - Quiz Questions
Software Architecture - Quiz QuestionsGanesh Samarthyam
 
Core Java: Best practices and bytecodes quiz
Core Java: Best practices and bytecodes quizCore Java: Best practices and bytecodes quiz
Core Java: Best practices and bytecodes quizGanesh Samarthyam
 
Advanced Debugging Using Java Bytecodes
Advanced Debugging Using Java BytecodesAdvanced Debugging Using Java Bytecodes
Advanced Debugging Using Java BytecodesGanesh Samarthyam
 

Mehr von Ganesh Samarthyam (20)

Wonders of the Sea
Wonders of the SeaWonders of the Sea
Wonders of the Sea
 
Animals - for kids
Animals - for kids Animals - for kids
Animals - for kids
 
Applying Refactoring Tools in Practice
Applying Refactoring Tools in PracticeApplying Refactoring Tools in Practice
Applying Refactoring Tools in Practice
 
CFP - 1st Workshop on “AI Meets Blockchain”
CFP - 1st Workshop on “AI Meets Blockchain”CFP - 1st Workshop on “AI Meets Blockchain”
CFP - 1st Workshop on “AI Meets Blockchain”
 
Great Coding Skills Aren't Enough
Great Coding Skills Aren't EnoughGreat Coding Skills Aren't Enough
Great Coding Skills Aren't Enough
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - Description
 
Coding Guidelines - Crafting Clean Code
Coding Guidelines - Crafting Clean CodeCoding Guidelines - Crafting Clean Code
Coding Guidelines - Crafting Clean Code
 
Design Patterns - Compiler Case Study - Hands-on Examples
Design Patterns - Compiler Case Study - Hands-on ExamplesDesign Patterns - Compiler Case Study - Hands-on Examples
Design Patterns - Compiler Case Study - Hands-on Examples
 
Bangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Brief PresentationBangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Brief Presentation
 
Bangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - PosterBangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - Poster
 
Software Design in Practice (with Java examples)
Software Design in Practice (with Java examples)Software Design in Practice (with Java examples)
Software Design in Practice (with Java examples)
 
OO Design and Design Patterns in C++
OO Design and Design Patterns in C++ OO Design and Design Patterns in C++
OO Design and Design Patterns in C++
 
Bangalore Container Conference 2017 - Sponsorship Deck
Bangalore Container Conference 2017 - Sponsorship DeckBangalore Container Conference 2017 - Sponsorship Deck
Bangalore Container Conference 2017 - Sponsorship Deck
 
Java Generics - Quiz Questions
Java Generics - Quiz QuestionsJava Generics - Quiz Questions
Java Generics - Quiz Questions
 
Java Generics - by Example
Java Generics - by ExampleJava Generics - by Example
Java Generics - by Example
 
Software Architecture - Quiz Questions
Software Architecture - Quiz QuestionsSoftware Architecture - Quiz Questions
Software Architecture - Quiz Questions
 
Docker by Example - Quiz
Docker by Example - QuizDocker by Example - Quiz
Docker by Example - Quiz
 
Core Java: Best practices and bytecodes quiz
Core Java: Best practices and bytecodes quizCore Java: Best practices and bytecodes quiz
Core Java: Best practices and bytecodes quiz
 
Advanced Debugging Using Java Bytecodes
Advanced Debugging Using Java BytecodesAdvanced Debugging Using Java Bytecodes
Advanced Debugging Using Java Bytecodes
 
Java Class Design
Java Class DesignJava Class Design
Java Class Design
 

Kürzlich hochgeladen

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
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
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 

Kürzlich hochgeladen (20)

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
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...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 

Google's Go Programming Language - Introduction

  • 1. Google’s Go Introduction to the next “C” language! S G Ganesh
  • 2. Agenda  Introduction to Go (What is “Go”?)  “Hello world” in Go  Examples for “getting a hang of” Go  Examples using some novel features  Implementation status  Resources  Let’s Go!
  • 3. First things first: Setting the stage  It’s not possible to cover all details of a new language in a 45-mins presentation  We’ll quickly cover most important aspects of Go  Can’t drink ocean in a day – let alone in an hour!  No one is an “expert” in Go yet  Creators of the language are the only experts right now  I am an early adopter and got hooked-on to the language  I am making this presentation based on my experience  For many questions, there are no right or wrong answers:  Go is still an evolving language and answers might change!
  • 4. So, what’s all the buzz about?  Go: new programming language announced by Google (Sep 09)  Created lots of excitement in the programming community  Many tout it as the next C language  ‘C’ evolved from ‘B’; many languages are named as ‘D’, or want to be the ‘D’ language  But nothing has made the cut so far; “Go” might (or will it be “Gone” in a few years ;-) )  Is there substance behind hype?  Yes, a lot! Most system programmers find it very good  Go won Tiobe’s ‘language of the year award 2009’  Tiobe is a programming language popularity index: http://www.tiobe.com/  Latest status (march 2010)
  • 5. Okay, so what’s Go?  Go is a new, experimental, concurrent, garbage-collected, systems-programming language.  New & Experimental: Go is still at experimental stage  with tools, packages etc. still in development.  No production system implemented using Go till now  Concurrent: Supports 'communication channels’ for concurrency - Communicating Sequential Processes (CSP).  Garbage-collected: The memory is automatically garbage collected  For systems-programming: Intended for writing things like compilers, web servers…  Still, we can use it as a general purpose language.
  • 6. Who’s behind Go?  Robert Griesemer, Ken Thompson (of Unix fame), and Rob Pike are the creators of the language.  All three are well-known in programming community  This is how things fell in place:  Go project was started around May 2007. Ken Thompson wrote a Go compiler and runtime from scratch.  By mid of 2008, working compiler and runtime was ready.  Ian Lance Taylor and Russ Cox joined Go team in 2008. Ian Taylor implemented GCC front-end for Go.
  • 7. Why a new language?  This description is as given by the creators  No major sys. programming language came-up in last decade. But much has changed during the last decade(s)  Libraries becoming bigger with lots of dependencies  Internet and networking is becoming pervasive  Client/server systems, massive clusters used today  Multi-core processors becoming mainstream.  Systems programming languages were not designed with these in mind.  Other reasons  construction (enterprise software) has become very slow  OOP using inheritance hierarchies not effective
  • 8. Goals of the language  Efficiency and ease of use:  Efficiency of C, but ease like Ruby.  Performance: within 10%-20% of equivalent C  Safe to use:  Both type-safe as well as memory-safe.  Concurrency:  Good support for concurrency and communication  Garbage Collected:  "Attempts" to build an efficient, and latency-free Garbage Collection mechanism.  High-speed builds:  Fast compilation & linking
  • 9. Some important capabilities of Go  Simplicity: GO has a clean and concise syntax  Characteristic of Google products  For example, light-weight type system  Use it to believe it  Separation of interface and the implementation  I know it’s often misused statement, but Go has it!  Arguably a novel feature of Go  Goroutines  Is based on CSP: much safer than lock-based, like Java  And more:  E.g. Reflection (yes! but this is systems prog. lang!)
  • 10. Enough theory, lets see examples!  All programs in Go should be in a package, its “main” here  We import “fmt” package for using Printf function  Execution starts with ‘main.main()’ function  Functions have “func” keyword  Printf is in fmt package
  • 11. Now we’ll find factorial of a number  Lack of declarations  “fact” and “i” inferred as “ints” from init value 1 because of :=  “for” loop is the only loop construct supported in Go  Others like “while” are variations of “for”  An example of minimal features  Note the lack of semi-colons  Have to use only if “necessary”
  • 12. Looks like C, but not C!  Go has elegant declaration syntax  See how arguments are passed and returned  Not like C: it is infamous for its declaration syntax  Can return multiple values from functions  See swap for similar functionality in = operator  Example for “orthogonal” language features
  • 13. Built-in support for features like maps  Maps are built-in, so no need to import  Initialized with pair separated by “:”  “range” keyword is useful for traversal  Using a for loop  Works for slices, strings etc. (“orthogonal” feature)
  • 14. Functions as first class objects  Functions are first class objects in Go  We can have “function literals” (similar to “closures” in functional languages) for example
  • 15. Structures  Structs are declared with type keyword  We can have struct literals  Created in heap  And print struct members using %v in Printf
  • 16. Methods  Methods are implemented by specifying the struct name before the method name
  • 17. Interfaces: A novel feature  Interfaces specified with ‘interface’ keyword  Not same as in C#/Java  The structs doesn’t have to say it implements an interface  Any struct that implements the methods as specified by any interface satisfies that interface  Strict static type checking & “duck typing”!
  • 18. Goroutines: easy & safe multithreading  Goroutines are functions executing in parallel  in the same address space in stack  They communicate using “channels” (based on CSP)  Cleaner, simpler and less-bug prone than using locks  This shows an example* of how a Sort on big list can be done in parallel with some other computation
  • 19. We haven’t covered a lot!  Important features not covered because of limited time  reflection, embedding structs (aka inheritance), package construction etc.  Lots of libraries already implemented  math, crypto, networking, regex, OS, testing, html gen….  Garbage collection & Go runtime capabilities  Currently mark-and-sweep collector, but better ones under construction  Small runtime: GC, channels, stack allocation, goroutines etc.
  • 20. Implementation status  Currently compiler tool-chain available for Mac & Linux  No “official” windows port; “unofficial” old ports exist  Compilers: GCC implementation and a stand-alone implementation  You can download the compilers/tools from this website & try it  It’s open source (BSD license): We can contribute!  Lots of work going on in libraries and improving the existing tool chain  Frequent builds & releases, quick response times etc.  Many features & tools still lacking in Go  For example, generics and debugger tool
  • 21. Resources  Go websites:  Official: www.golang.org (web server implemented in Go!)  Unofficial: http://go-lang.cat-v.org/  Want to learn Go?  No “books” yet  Read "Effective Go” (http://golang.org/doc/effective_go.html)  tutorials available online  Tech talk (http://www.youtube.com/watch?v=rKnDgT73v8s)  Join go-nuts mailing list gonuts@googlegroups.com  You can try (compile & run) Go programs online!  This is really useful: http://ideone.com/
  • 22. Q & A time
  • 23. So what are you waiting for?  Lets Go!