SlideShare a Scribd company logo
Let’s Go:
Introducing Google's New Programming Language		
Google's announcement of Go programming language during October 2009 has created lots of interest in
programming community. This article introduces Go to system programmers and cover some of the
novel/useful features of the language.
S G Ganesh, sgganesh@gmail.com
This is an article to introduce Go language. Readers will have lots of questions when they come
across a new (and promising) language, but because of limited space, I’ll cover only most important
aspects of Go in this article.
What is Go?
Go is a new, experimental, concurrent, garbage-collected, systems programming language.
new: It is a new language, and was publicly announced during the end of 2009.
experimental: It is still at experimental stage with tools, packages etc. still in development. There is no
production system implemented in Go as I write this article.
concurrent: It is a concurrent language which supports 'communication channels' which is based on
Hoare's Communicating Sequential Processes (CSP).
garbage-collected: The memory is automatically garbage collected, which relieves of the programmer
from manual bookkeeping of memory (as done in C/C++).
for systems-programming: It is intended for writing things like web servers. Still, we can use it as a
general purpose language.
Robert Griesemer, Ken Thompson (of Unix fame), and Rob Pike are the creators of the language.
All of Go’s toolset (compilers, packages, runtime libraries, tools etc) are made open source under
BSD license.
Goals and motivation
Let us first see what motivated Go’s creators for coming up with this new language. In last decade,
much has changed in computing world: Libraries have become bigger with
lots of dependencies which makes enterprise software development unbearably slow; internet and
networking has becoming pervasive; multi-core processors becoming mainstream and so on.
Systems programming languages (like C) were not designed with these in mind.
Concurrency features. The creators of the language found that there is a genuine need for a systems
programming language that is suitable for this new world. Go is suitable for use in multi-core and
networked world: Go is a concurrent language. It has ‘communication channels’ feature which is
much safer and different from threads and lock-based concurrency (like Java or Pthreads).
High-speed builds. It is faster to build applications with Go: The language is designed for fast
compilation in mind. Examples: the compiler does not need a symbol-table(!); the parser does not
need any look-ahead of tokens(!). Package dependencies are made explicit; dependent packages
require recompilation only if really needed: features like this enables quick builds. This approach is
unlike other languages like C, C++, Java etc.
Safe to use. Low-level languages like C are bug prone, particularly with manual memory management
and pointer manipulation. Go is garbage collected and is memory safe. It is a strictly typed language
and disallows unsafe programming (pointer manipulation is not allowed, for example), so it is also
type-safe.
Efficiency. Performance of Go code is within 10%-20% of the equivalent C code. Given the fact that
it supports features like reflection and garbage collection, the ability to execute write such efficient
programs is interesting (and impressive).
Ease of use. Go brings the ease of programming of a dynamically typed language, like Ruby and
Python. This is a surprising feature given the fact that it is a type-safe, statically typed language. The
code is also less verbose, with its features like type-inference (unlike Java, for example).
‘Hello world’ Example
It is a tradition to introduce a language by giving a ‘Hello world’ example, so here it is:
package main
func main() {
print("Hello world")
}
It prints ‘Hello world’ if you run it, as you would expect. Now, let us discuss about the program.
All the programs in Go should be in a package. In Go, the execution starts with ‘main.main()’
function. In other words, our ‘main’ function should be provided in ‘main’ package; that is what the
first statement does.
All functions are defined using ‘func’ keyword. The ‘main’ function takes no arguments and returns
nothing. We will not cover how to process command-line arguments in this article.
Go has a set of ‘built-in functions’ and ‘print’ is one of them. Alternatively, we could have used C-
like ‘Printf’ function from ‘fmt’ package (which provides formatted input/output functions).
Note that there are no semicolons in this program. This is a nice feature of Go: In most of the cases,
semicolons is optional. However, in few cases, we have to explicitly use semi-colons, and we’ll not
cover that issue in this article.
Novel features of Go
When I started learning Go, I found that it has many novel features. One of the best features is its
interface feature (not to be confused with ‘interface’ keyword in Java/C#). Any structure that
implements a set of methods given by an interface is considered to implement that interface! I saw
sample code in the Go source packages and was impressed by the simplicity and beauty of the
feature. Note that many dynamic languages support ‘duck typing’ which is more sophisticated and
flexible. However, Go achieves limited form of ‘duck typing’ with type-safety and flexibility, in a
statically typed language and that too meant for systems programming!
Go has an elegant declaration syntax different from most C-based languages. Go supports
‘goroutines’ (not same as ‘threads’ or ‘coroutines’ as in other languages), which is a powerful feature
for writing concurrent programs. We can use reflection in Go (remember it is a systems programming
language!). The support for packages and the way methods are imported/exported is simple and
straight-forward (no keywords like ‘public’, ‘export’ etc are needed, for example). There are more,
but I’ll leave it to you to discover them yourselves.
Installing Go
Currently, Go implementations are available for two platforms: Linux and Mac OS X. There are two
implementations for these platforms: One is a stand-alone implementation of Go compiler and
runtime, written by Ken Thompson. Another is a GCC front-end, implemented by Ian Lance
Taylor.
You can download and install Go by following the instructions given in Go’s official website:
http://golang.org/doc/install.html.
What about Windows? There is no official port of Go available for Windows and we can use
“unofficial ports” as of now (check unofficial Go site: http://go-lang.cat-v.org/os-ports).
I tried installing both Windows and Linux versions, and the installation was easy and smooth.
Wrapping up
With my experience in trying Go for last few months and writing non-trivial programs, I think there
is lots of substance behind hype: Go is certainly a language that has some unique features that will
make it as a useful systems programming language in this age of internet and multi-core processors.
So, it is not a surprised when I came to know that Go won Tiobe’s ‘language of the year award 2009’
(it won the award just after few months of its announcement!).
The best feature like liked in Go is its simplicity (yes, I am considering it a feature)! In just a couple of
days I have started learning Go, I was able to write non-trivial programs and started liking it. It was
fun learning and playing with the language. I would recommend Go to any systems programmer and
encourage trying it out.

More Related Content

What's hot (20)

Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
Amal Mohan N
 
Go Lang
Go LangGo Lang
Go Lang
Venkata Naga Ravi
 
Go Language presentation
Go Language presentationGo Language presentation
Go Language presentation
Gh-Mohammed Eldadah
 
Go programing language
Go programing languageGo programing language
Go programing language
Ramakrishna kapa
 
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, golang
Basil N G
 
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
 
Golang introduction
Golang introductionGolang introduction
Golang introduction
DineshDinesh131
 
Go lang
Go langGo lang
Go lang
Suelen Carvalho
 
Evolution or stagnation programming languages
Evolution or stagnation programming languagesEvolution or stagnation programming languages
Evolution or stagnation programming languages
Daniele Esposti
 
Golang 101
Golang 101Golang 101
Golang 101
宇 傅
 
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
 
Difference between c, c++ and java
Difference between c, c++ and javaDifference between c, c++ and java
Difference between c, c++ and java
Mohanasundaram Nattudurai
 
Python Intro For Managers
Python Intro For ManagersPython Intro For Managers
Python Intro For Managers
Atul Shridhar
 
Computer Programming Overview
Computer Programming OverviewComputer Programming Overview
Computer Programming Overview
agorolabs
 
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
groversimrans
 
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
Mahmoud Samir Fayed
 
Google GO
Google GOGoogle GO
Google GO
Ajay Gahlot
 
An Introduction to Go
An Introduction to GoAn Introduction to Go
An Introduction to Go
Imesh Gunaratne
 
Introduction to go lang
Introduction to go langIntroduction to go lang
Introduction to go lang
Amal 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, golang
Basil N G
 
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 languages
Daniele Esposti
 
Golang 101
Golang 101Golang 101
Golang 101
宇 傅
 
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
 
Python Intro For Managers
Python Intro For ManagersPython Intro For Managers
Python Intro For Managers
Atul Shridhar
 
Computer Programming Overview
Computer Programming OverviewComputer Programming Overview
Computer Programming Overview
agorolabs
 
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
groversimrans
 
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
Mahmoud Samir Fayed
 

Viewers also liked (20)

Bangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - PosterBangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - Poster
Ganesh Samarthyam
 
Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...
Ganesh Samarthyam
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
Ganesh Samarthyam
 
Writing an Abstract - Template (for research papers)
Writing an Abstract - Template (for research papers) Writing an Abstract - Template (for research papers)
Writing an Abstract - Template (for research papers)
Ganesh Samarthyam
 
Refactoring guided by design principles driven by technical debt
Refactoring   guided by design principles driven by technical debtRefactoring   guided by design principles driven by technical debt
Refactoring guided by design principles driven by technical debt
Ganesh Samarthyam
 
Tools for Refactoring
Tools for RefactoringTools for Refactoring
Tools for Refactoring
Ganesh Samarthyam
 
Design Smell Descriptions - Summary Sheet
Design Smell Descriptions - Summary SheetDesign Smell Descriptions - Summary Sheet
Design Smell Descriptions - Summary Sheet
Ganesh Samarthyam
 
Java Generics - by Example
Java Generics - by ExampleJava Generics - by Example
Java Generics - by Example
Ganesh Samarthyam
 
a wild Supposition: can MySQL be Kafka ?
a wild Supposition: can MySQL be Kafka ?a wild Supposition: can MySQL be Kafka ?
a wild Supposition: can MySQL be Kafka ?
vishnu rao
 
Punch clock for debugging apache storm
Punch clock for  debugging apache stormPunch clock for  debugging apache storm
Punch clock for debugging apache storm
vishnu rao
 
Build your own Real Time Analytics and Visualization, Enable Complex Event Pr...
Build your own Real Time Analytics and Visualization, Enable Complex Event Pr...Build your own Real Time Analytics and Visualization, Enable Complex Event Pr...
Build your own Real Time Analytics and Visualization, Enable Complex Event Pr...
vishnu rao
 
Do you need microservices architecture?
Do you need microservices architecture?Do you need microservices architecture?
Do you need microservices architecture?
Manu Pk
 
12 Cool Google Maps Mashups
12 Cool Google Maps Mashups12 Cool Google Maps Mashups
12 Cool Google Maps Mashups
Apisilp Trunganont
 
Google Maps Guiding Your Classroom
Google Maps  Guiding Your ClassroomGoogle Maps  Guiding Your Classroom
Google Maps Guiding Your Classroom
Chris Scott
 
Software Quality for Programmers
Software Quality for ProgrammersSoftware Quality for Programmers
Software Quality for Programmers
Pawel Klimczyk
 
No pain, no gain. CSS Code Reviews FTW.
No pain, no gain. CSS Code Reviews FTW.No pain, no gain. CSS Code Reviews FTW.
No pain, no gain. CSS Code Reviews FTW.
Stacy Kvernmo
 
Demystifying datastores
Demystifying datastoresDemystifying datastores
Demystifying datastores
vishnu rao
 
Visualising Basic Concepts of Docker
Visualising Basic Concepts of Docker Visualising Basic Concepts of Docker
Visualising Basic Concepts of Docker
vishnu rao
 
Golang 入門初體驗
Golang 入門初體驗Golang 入門初體驗
Golang 入門初體驗
政斌 楊
 
Google Products & Google Maps
Google Products & Google MapsGoogle Products & Google Maps
Google Products & Google Maps
Pamela Fox
 
Bangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - PosterBangalore Container Conference 2017 - Poster
Bangalore Container Conference 2017 - Poster
Ganesh Samarthyam
 
Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...
Ganesh Samarthyam
 
Writing an Abstract - Template (for research papers)
Writing an Abstract - Template (for research papers) Writing an Abstract - Template (for research papers)
Writing an Abstract - Template (for research papers)
Ganesh Samarthyam
 
Refactoring guided by design principles driven by technical debt
Refactoring   guided by design principles driven by technical debtRefactoring   guided by design principles driven by technical debt
Refactoring guided by design principles driven by technical debt
Ganesh Samarthyam
 
Design Smell Descriptions - Summary Sheet
Design Smell Descriptions - Summary SheetDesign Smell Descriptions - Summary Sheet
Design Smell Descriptions - Summary Sheet
Ganesh Samarthyam
 
a wild Supposition: can MySQL be Kafka ?
a wild Supposition: can MySQL be Kafka ?a wild Supposition: can MySQL be Kafka ?
a wild Supposition: can MySQL be Kafka ?
vishnu rao
 
Punch clock for debugging apache storm
Punch clock for  debugging apache stormPunch clock for  debugging apache storm
Punch clock for debugging apache storm
vishnu rao
 
Build your own Real Time Analytics and Visualization, Enable Complex Event Pr...
Build your own Real Time Analytics and Visualization, Enable Complex Event Pr...Build your own Real Time Analytics and Visualization, Enable Complex Event Pr...
Build your own Real Time Analytics and Visualization, Enable Complex Event Pr...
vishnu rao
 
Do you need microservices architecture?
Do you need microservices architecture?Do you need microservices architecture?
Do you need microservices architecture?
Manu Pk
 
Google Maps Guiding Your Classroom
Google Maps  Guiding Your ClassroomGoogle Maps  Guiding Your Classroom
Google Maps Guiding Your Classroom
Chris Scott
 
Software Quality for Programmers
Software Quality for ProgrammersSoftware Quality for Programmers
Software Quality for Programmers
Pawel Klimczyk
 
No pain, no gain. CSS Code Reviews FTW.
No pain, no gain. CSS Code Reviews FTW.No pain, no gain. CSS Code Reviews FTW.
No pain, no gain. CSS Code Reviews FTW.
Stacy Kvernmo
 
Demystifying datastores
Demystifying datastoresDemystifying datastores
Demystifying datastores
vishnu rao
 
Visualising Basic Concepts of Docker
Visualising Basic Concepts of Docker Visualising Basic Concepts of Docker
Visualising Basic Concepts of Docker
vishnu rao
 
Golang 入門初體驗
Golang 入門初體驗Golang 入門初體驗
Golang 入門初體驗
政斌 楊
 
Google Products & Google Maps
Google Products & Google MapsGoogle Products & Google Maps
Google Products & Google Maps
Pamela Fox
 
Ad

Similar to Let's Go: Introduction to Google's Go Programming Language (20)

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
 
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
Mahmoud Samir Fayed
 
Beginning development in go
Beginning development in goBeginning development in go
Beginning development in go
Equaleyes Solutions Ltd.
 
Scaling applications with go
Scaling applications with goScaling applications with go
Scaling applications with go
Vimlesh Sharma
 
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
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
Simon Hewitt
 
The Ring programming language version 1.5.3 book - Part 5 of 184
The Ring programming language version 1.5.3 book - Part 5 of 184The Ring programming language version 1.5.3 book - Part 5 of 184
The Ring programming language version 1.5.3 book - Part 5 of 184
Mahmoud Samir Fayed
 
Go Within Cloud Foundry
Go Within Cloud FoundryGo Within Cloud Foundry
Go Within Cloud Foundry
Platform CF
 
Hire golang developers and make the shift to brighter business future (build ...
Hire golang developers and make the shift to brighter business future (build ...Hire golang developers and make the shift to brighter business future (build ...
Hire golang developers and make the shift to brighter business future (build ...
Katy Slemon
 
Intermediate Languages
Intermediate LanguagesIntermediate Languages
Intermediate Languages
Ganesh Samarthyam
 
The Ring programming language version 1.5.4 book - Part 5 of 185
The Ring programming language version 1.5.4 book - Part 5 of 185The Ring programming language version 1.5.4 book - Part 5 of 185
The Ring programming language version 1.5.4 book - Part 5 of 185
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 5 of 181
The Ring programming language version 1.5.2 book - Part 5 of 181The Ring programming language version 1.5.2 book - Part 5 of 181
The Ring programming language version 1.5.2 book - Part 5 of 181
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 6 of 212
The Ring programming language version 1.10 book - Part 6 of 212The Ring programming language version 1.10 book - Part 6 of 212
The Ring programming language version 1.10 book - Part 6 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 4 of 88
The Ring programming language version 1.3 book - Part 4 of 88The Ring programming language version 1.3 book - Part 4 of 88
The Ring programming language version 1.3 book - Part 4 of 88
Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 6 of 210
The Ring programming language version 1.9 book - Part 6 of 210The Ring programming language version 1.9 book - Part 6 of 210
The Ring programming language version 1.9 book - Part 6 of 210
Mahmoud Samir Fayed
 
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
Katy Slemon
 
Which programming language should you learn next?
Which programming language should you learn next? Which programming language should you learn next?
Which programming language should you learn next?
Ganesh Samarthyam
 
The Ring programming language version 1.9 book - Part 97 of 210
The Ring programming language version 1.9 book - Part 97 of 210The Ring programming language version 1.9 book - Part 97 of 210
The Ring programming language version 1.9 book - Part 97 of 210
Mahmoud 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 84
Mahmoud Samir Fayed
 
5 Reasons why Business Choose Go Program for Software Development
5 Reasons why Business Choose Go Program for Software Development5 Reasons why Business Choose Go Program for Software Development
5 Reasons why Business Choose Go Program for Software Development
NelsonSEO
 
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
 
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
Mahmoud Samir Fayed
 
Scaling applications with go
Scaling applications with goScaling applications with go
Scaling applications with go
Vimlesh Sharma
 
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
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
Simon Hewitt
 
The Ring programming language version 1.5.3 book - Part 5 of 184
The Ring programming language version 1.5.3 book - Part 5 of 184The Ring programming language version 1.5.3 book - Part 5 of 184
The Ring programming language version 1.5.3 book - Part 5 of 184
Mahmoud Samir Fayed
 
Go Within Cloud Foundry
Go Within Cloud FoundryGo Within Cloud Foundry
Go Within Cloud Foundry
Platform CF
 
Hire golang developers and make the shift to brighter business future (build ...
Hire golang developers and make the shift to brighter business future (build ...Hire golang developers and make the shift to brighter business future (build ...
Hire golang developers and make the shift to brighter business future (build ...
Katy Slemon
 
The Ring programming language version 1.5.4 book - Part 5 of 185
The Ring programming language version 1.5.4 book - Part 5 of 185The Ring programming language version 1.5.4 book - Part 5 of 185
The Ring programming language version 1.5.4 book - Part 5 of 185
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 5 of 181
The Ring programming language version 1.5.2 book - Part 5 of 181The Ring programming language version 1.5.2 book - Part 5 of 181
The Ring programming language version 1.5.2 book - Part 5 of 181
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 6 of 212
The Ring programming language version 1.10 book - Part 6 of 212The Ring programming language version 1.10 book - Part 6 of 212
The Ring programming language version 1.10 book - Part 6 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 4 of 88
The Ring programming language version 1.3 book - Part 4 of 88The Ring programming language version 1.3 book - Part 4 of 88
The Ring programming language version 1.3 book - Part 4 of 88
Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 6 of 210
The Ring programming language version 1.9 book - Part 6 of 210The Ring programming language version 1.9 book - Part 6 of 210
The Ring programming language version 1.9 book - Part 6 of 210
Mahmoud Samir Fayed
 
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
Katy Slemon
 
Which programming language should you learn next?
Which programming language should you learn next? Which programming language should you learn next?
Which programming language should you learn next?
Ganesh Samarthyam
 
The Ring programming language version 1.9 book - Part 97 of 210
The Ring programming language version 1.9 book - Part 97 of 210The Ring programming language version 1.9 book - Part 97 of 210
The Ring programming language version 1.9 book - Part 97 of 210
Mahmoud 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 84
Mahmoud Samir Fayed
 
5 Reasons why Business Choose Go Program for Software Development
5 Reasons why Business Choose Go Program for Software Development5 Reasons why Business Choose Go Program for Software Development
5 Reasons why Business Choose Go Program for Software Development
NelsonSEO
 
Ad

More from Ganesh Samarthyam (20)

Wonders of the Sea
Wonders of the SeaWonders of the Sea
Wonders of the Sea
Ganesh Samarthyam
 
Animals - for kids
Animals - for kids Animals - for kids
Animals - for kids
Ganesh Samarthyam
 
Applying Refactoring Tools in Practice
Applying Refactoring Tools in PracticeApplying Refactoring Tools in Practice
Applying Refactoring Tools in Practice
Ganesh 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 Enough
Ganesh Samarthyam
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - Description
Ganesh Samarthyam
 
Coding Guidelines - Crafting Clean Code
Coding Guidelines - Crafting Clean CodeCoding Guidelines - Crafting Clean Code
Coding Guidelines - Crafting Clean Code
Ganesh 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 Examples
Ganesh Samarthyam
 
Bangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Brief PresentationBangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Brief Presentation
Ganesh 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 Deck
Ganesh Samarthyam
 
Java Generics - Quiz Questions
Java Generics - Quiz QuestionsJava Generics - Quiz Questions
Java Generics - Quiz Questions
Ganesh Samarthyam
 
Software Architecture - Quiz Questions
Software Architecture - Quiz QuestionsSoftware Architecture - Quiz Questions
Software Architecture - Quiz Questions
Ganesh Samarthyam
 
Docker by Example - Quiz
Docker by Example - QuizDocker by Example - Quiz
Docker by Example - Quiz
Ganesh 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 quiz
Ganesh Samarthyam
 
Advanced Debugging Using Java Bytecodes
Advanced Debugging Using Java BytecodesAdvanced Debugging Using Java Bytecodes
Advanced Debugging Using Java Bytecodes
Ganesh Samarthyam
 
Java Class Design
Java Class DesignJava Class Design
Java Class Design
Ganesh Samarthyam
 
Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...
Ganesh Samarthyam
 
Refactoring for Software Design Smells - XP Conference - August 20th 2016
Refactoring for Software Design Smells - XP Conference - August 20th 2016Refactoring for Software Design Smells - XP Conference - August 20th 2016
Refactoring for Software Design Smells - XP Conference - August 20th 2016
Ganesh Samarthyam
 
Applying Refactoring Tools in Practice
Applying Refactoring Tools in PracticeApplying Refactoring Tools in Practice
Applying Refactoring Tools in Practice
Ganesh 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 Enough
Ganesh Samarthyam
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - Description
Ganesh Samarthyam
 
Coding Guidelines - Crafting Clean Code
Coding Guidelines - Crafting Clean CodeCoding Guidelines - Crafting Clean Code
Coding Guidelines - Crafting Clean Code
Ganesh 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 Examples
Ganesh Samarthyam
 
Bangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Brief PresentationBangalore Container Conference 2017 - Brief Presentation
Bangalore Container Conference 2017 - Brief Presentation
Ganesh 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 Deck
Ganesh Samarthyam
 
Java Generics - Quiz Questions
Java Generics - Quiz QuestionsJava Generics - Quiz Questions
Java Generics - Quiz Questions
Ganesh Samarthyam
 
Software Architecture - Quiz Questions
Software Architecture - Quiz QuestionsSoftware Architecture - Quiz Questions
Software Architecture - Quiz Questions
Ganesh 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 quiz
Ganesh Samarthyam
 
Advanced Debugging Using Java Bytecodes
Advanced Debugging Using Java BytecodesAdvanced Debugging Using Java Bytecodes
Advanced Debugging Using Java Bytecodes
Ganesh Samarthyam
 
Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...Refactoring for Software Architecture Smells - International Workshop on Refa...
Refactoring for Software Architecture Smells - International Workshop on Refa...
Ganesh Samarthyam
 
Refactoring for Software Design Smells - XP Conference - August 20th 2016
Refactoring for Software Design Smells - XP Conference - August 20th 2016Refactoring for Software Design Smells - XP Conference - August 20th 2016
Refactoring for Software Design Smells - XP Conference - August 20th 2016
Ganesh Samarthyam
 

Recently uploaded (20)

How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
Insurance Tech Services
 
How Insurance Policy Management Software Streamlines Operations
How Insurance Policy Management Software Streamlines OperationsHow Insurance Policy Management Software Streamlines Operations
How Insurance Policy Management Software Streamlines Operations
Insurance Tech Services
 
Plooma is a writing platform to plan, write, and shape books your way
Plooma is a writing platform to plan, write, and shape books your wayPlooma is a writing platform to plan, write, and shape books your way
Plooma is a writing platform to plan, write, and shape books your way
Plooma
 
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlowDevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
Aarno Aukia
 
FME for Climate Data: Turning Big Data into Actionable Insights
FME for Climate Data: Turning Big Data into Actionable InsightsFME for Climate Data: Turning Big Data into Actionable Insights
FME for Climate Data: Turning Big Data into Actionable Insights
Safe Software
 
OpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native BarcelonaOpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native Barcelona
Imma Valls Bernaus
 
Bonk coin airdrop_ Everything You Need to Know.pdf
Bonk coin airdrop_ Everything You Need to Know.pdfBonk coin airdrop_ Everything You Need to Know.pdf
Bonk coin airdrop_ Everything You Need to Know.pdf
Herond Labs
 
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps CyclesFrom Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
Marjukka Niinioja
 
Maintaining + Optimizing Database Health: Vendors, Orchestrations, Enrichment...
Maintaining + Optimizing Database Health: Vendors, Orchestrations, Enrichment...Maintaining + Optimizing Database Health: Vendors, Orchestrations, Enrichment...
Maintaining + Optimizing Database Health: Vendors, Orchestrations, Enrichment...
BradBedford3
 
Porting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 WebinarPorting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 Webinar
ICS
 
Essentials of Resource Planning in a Downturn
Essentials of Resource Planning in a DownturnEssentials of Resource Planning in a Downturn
Essentials of Resource Planning in a Downturn
OnePlan Solutions
 
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdfTop 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Trackobit
 
Software Testing & it’s types (DevOps)
Software  Testing & it’s  types (DevOps)Software  Testing & it’s  types (DevOps)
Software Testing & it’s types (DevOps)
S Pranav (Deepu)
 
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
WSO2
 
Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)
VICTOR MAESTRE RAMIREZ
 
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptxIMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
usmanch7829
 
COBOL Programming with VSCode - IBM Certificate
COBOL Programming with VSCode - IBM CertificateCOBOL Programming with VSCode - IBM Certificate
COBOL Programming with VSCode - IBM Certificate
VICTOR MAESTRE RAMIREZ
 
Revolutionize Your Insurance Workflow with Claims Management Software
Revolutionize Your Insurance Workflow with Claims Management SoftwareRevolutionize Your Insurance Workflow with Claims Management Software
Revolutionize Your Insurance Workflow with Claims Management Software
Insurance Tech Services
 
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Natan Silnitsky
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
Insurance Tech Services
 
How Insurance Policy Management Software Streamlines Operations
How Insurance Policy Management Software Streamlines OperationsHow Insurance Policy Management Software Streamlines Operations
How Insurance Policy Management Software Streamlines Operations
Insurance Tech Services
 
Plooma is a writing platform to plan, write, and shape books your way
Plooma is a writing platform to plan, write, and shape books your wayPlooma is a writing platform to plan, write, and shape books your way
Plooma is a writing platform to plan, write, and shape books your way
Plooma
 
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlowDevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
Aarno Aukia
 
FME for Climate Data: Turning Big Data into Actionable Insights
FME for Climate Data: Turning Big Data into Actionable InsightsFME for Climate Data: Turning Big Data into Actionable Insights
FME for Climate Data: Turning Big Data into Actionable Insights
Safe Software
 
OpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native BarcelonaOpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native Barcelona
Imma Valls Bernaus
 
Bonk coin airdrop_ Everything You Need to Know.pdf
Bonk coin airdrop_ Everything You Need to Know.pdfBonk coin airdrop_ Everything You Need to Know.pdf
Bonk coin airdrop_ Everything You Need to Know.pdf
Herond Labs
 
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps CyclesFrom Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
From Chaos to Clarity - Designing (AI-Ready) APIs with APIOps Cycles
Marjukka Niinioja
 
Maintaining + Optimizing Database Health: Vendors, Orchestrations, Enrichment...
Maintaining + Optimizing Database Health: Vendors, Orchestrations, Enrichment...Maintaining + Optimizing Database Health: Vendors, Orchestrations, Enrichment...
Maintaining + Optimizing Database Health: Vendors, Orchestrations, Enrichment...
BradBedford3
 
Porting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 WebinarPorting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 Webinar
ICS
 
Essentials of Resource Planning in a Downturn
Essentials of Resource Planning in a DownturnEssentials of Resource Planning in a Downturn
Essentials of Resource Planning in a Downturn
OnePlan Solutions
 
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdfTop 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Trackobit
 
Software Testing & it’s types (DevOps)
Software  Testing & it’s  types (DevOps)Software  Testing & it’s  types (DevOps)
Software Testing & it’s types (DevOps)
S Pranav (Deepu)
 
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
Build Smarter, Deliver Faster with Choreo - An AI Native Internal Developer P...
WSO2
 
Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)
VICTOR MAESTRE RAMIREZ
 
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptxIMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
usmanch7829
 
COBOL Programming with VSCode - IBM Certificate
COBOL Programming with VSCode - IBM CertificateCOBOL Programming with VSCode - IBM Certificate
COBOL Programming with VSCode - IBM Certificate
VICTOR MAESTRE RAMIREZ
 
Revolutionize Your Insurance Workflow with Claims Management Software
Revolutionize Your Insurance Workflow with Claims Management SoftwareRevolutionize Your Insurance Workflow with Claims Management Software
Revolutionize Your Insurance Workflow with Claims Management Software
Insurance Tech Services
 
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Natan Silnitsky
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 

Let's Go: Introduction to Google's Go Programming Language

  • 1. Let’s Go: Introducing Google's New Programming Language Google's announcement of Go programming language during October 2009 has created lots of interest in programming community. This article introduces Go to system programmers and cover some of the novel/useful features of the language. S G Ganesh, [email protected] This is an article to introduce Go language. Readers will have lots of questions when they come across a new (and promising) language, but because of limited space, I’ll cover only most important aspects of Go in this article. What is Go? Go is a new, experimental, concurrent, garbage-collected, systems programming language. new: It is a new language, and was publicly announced during the end of 2009. experimental: It is still at experimental stage with tools, packages etc. still in development. There is no production system implemented in Go as I write this article. concurrent: It is a concurrent language which supports 'communication channels' which is based on Hoare's Communicating Sequential Processes (CSP). garbage-collected: The memory is automatically garbage collected, which relieves of the programmer from manual bookkeeping of memory (as done in C/C++). for systems-programming: It is intended for writing things like web servers. Still, we can use it as a general purpose language. Robert Griesemer, Ken Thompson (of Unix fame), and Rob Pike are the creators of the language. All of Go’s toolset (compilers, packages, runtime libraries, tools etc) are made open source under BSD license. Goals and motivation Let us first see what motivated Go’s creators for coming up with this new language. In last decade, much has changed in computing world: Libraries have become bigger with lots of dependencies which makes enterprise software development unbearably slow; internet and networking has becoming pervasive; multi-core processors becoming mainstream and so on. Systems programming languages (like C) were not designed with these in mind. Concurrency features. The creators of the language found that there is a genuine need for a systems programming language that is suitable for this new world. Go is suitable for use in multi-core and networked world: Go is a concurrent language. It has ‘communication channels’ feature which is much safer and different from threads and lock-based concurrency (like Java or Pthreads). High-speed builds. It is faster to build applications with Go: The language is designed for fast compilation in mind. Examples: the compiler does not need a symbol-table(!); the parser does not
  • 2. need any look-ahead of tokens(!). Package dependencies are made explicit; dependent packages require recompilation only if really needed: features like this enables quick builds. This approach is unlike other languages like C, C++, Java etc. Safe to use. Low-level languages like C are bug prone, particularly with manual memory management and pointer manipulation. Go is garbage collected and is memory safe. It is a strictly typed language and disallows unsafe programming (pointer manipulation is not allowed, for example), so it is also type-safe. Efficiency. Performance of Go code is within 10%-20% of the equivalent C code. Given the fact that it supports features like reflection and garbage collection, the ability to execute write such efficient programs is interesting (and impressive). Ease of use. Go brings the ease of programming of a dynamically typed language, like Ruby and Python. This is a surprising feature given the fact that it is a type-safe, statically typed language. The code is also less verbose, with its features like type-inference (unlike Java, for example). ‘Hello world’ Example It is a tradition to introduce a language by giving a ‘Hello world’ example, so here it is: package main func main() { print("Hello world") } It prints ‘Hello world’ if you run it, as you would expect. Now, let us discuss about the program. All the programs in Go should be in a package. In Go, the execution starts with ‘main.main()’ function. In other words, our ‘main’ function should be provided in ‘main’ package; that is what the first statement does. All functions are defined using ‘func’ keyword. The ‘main’ function takes no arguments and returns nothing. We will not cover how to process command-line arguments in this article. Go has a set of ‘built-in functions’ and ‘print’ is one of them. Alternatively, we could have used C- like ‘Printf’ function from ‘fmt’ package (which provides formatted input/output functions). Note that there are no semicolons in this program. This is a nice feature of Go: In most of the cases, semicolons is optional. However, in few cases, we have to explicitly use semi-colons, and we’ll not cover that issue in this article. Novel features of Go When I started learning Go, I found that it has many novel features. One of the best features is its interface feature (not to be confused with ‘interface’ keyword in Java/C#). Any structure that implements a set of methods given by an interface is considered to implement that interface! I saw
  • 3. sample code in the Go source packages and was impressed by the simplicity and beauty of the feature. Note that many dynamic languages support ‘duck typing’ which is more sophisticated and flexible. However, Go achieves limited form of ‘duck typing’ with type-safety and flexibility, in a statically typed language and that too meant for systems programming! Go has an elegant declaration syntax different from most C-based languages. Go supports ‘goroutines’ (not same as ‘threads’ or ‘coroutines’ as in other languages), which is a powerful feature for writing concurrent programs. We can use reflection in Go (remember it is a systems programming language!). The support for packages and the way methods are imported/exported is simple and straight-forward (no keywords like ‘public’, ‘export’ etc are needed, for example). There are more, but I’ll leave it to you to discover them yourselves. Installing Go Currently, Go implementations are available for two platforms: Linux and Mac OS X. There are two implementations for these platforms: One is a stand-alone implementation of Go compiler and runtime, written by Ken Thompson. Another is a GCC front-end, implemented by Ian Lance Taylor. You can download and install Go by following the instructions given in Go’s official website: http://golang.org/doc/install.html. What about Windows? There is no official port of Go available for Windows and we can use “unofficial ports” as of now (check unofficial Go site: http://go-lang.cat-v.org/os-ports). I tried installing both Windows and Linux versions, and the installation was easy and smooth. Wrapping up With my experience in trying Go for last few months and writing non-trivial programs, I think there is lots of substance behind hype: Go is certainly a language that has some unique features that will make it as a useful systems programming language in this age of internet and multi-core processors. So, it is not a surprised when I came to know that Go won Tiobe’s ‘language of the year award 2009’ (it won the award just after few months of its announcement!). The best feature like liked in Go is its simplicity (yes, I am considering it a feature)! In just a couple of days I have started learning Go, I was able to write non-trivial programs and started liking it. It was fun learning and playing with the language. I would recommend Go to any systems programmer and encourage trying it out.