Go or Golang is a programming language created at Google, by Google developers and other programmers. This programming language is free and open-source and currently being maintained by Google. One of the founding members of Go is Ken Thompson who is best known for his work on Unix operating system development. Go compiler was initially written in C
but now, it is written in Go, making it self hosted.
So what’s so special about Go?
- Go is statically typed compiled language.
- It supports the built-in concurrency model with the help of GoRoutines.
- It has a built-in garbage collector and memory safety.
- Strings in Go are UTF-8 encoded by default.
- It has simpler syntax compared to other compiled programming languages.
The motivation behind its creation
There are tons of programming languages to choose from nowadays. Each language has its own benefits and different programmers find different languages friendlier than others.
But a language should be perfect in all sense and should be easy to work with for any programmer. A programming language can be great at performing only one task like COBOL or can be used for general-purpose programming, like Java or JavaScript.
The four important things a language must thrive to achieve is speed/efficiency, reliability, scale, and simplicity.
If we consider languages like C
or C++
, they are great at speed, *scale, *and reliability but in terms of simplicity, they are not so great.
Java
on the other hand is very reliable and highly scalable, but moderately simple to write and not so efficient compared to other low-level languages. Python
is a widely adopted language and very simple to write but not so efficient and reliable.
Whenever Google creates a language or a framework, I suppose it’s because they want to eventually use it in their own organization. Angular, Material design, Dart, Flutter, etc. are a few examples.
Google back in 2008—2010 was looking for a language that could be great at all these 4 things. I guess their idea was to replace traditional low-level programming languages with this new language in their own infrastructure.
Hence with the help of Ken Thompson, Rob Pike, and Robert Griesemer, they created a language Go that could give developers the experience of writing a scripting (interpreted) language like Python or JavaScript but at the same time, provides quirks of low-level compiled programming languages.
Their major focus was on simplicity, scale, speed, and reliability. Since Go is a commonly used English word, searching Go programming related things on the internet is not so easy, hence many people use GoLang instead.
Things that make Go a great programming language is its simple concurrency model, its package based code management and its non-strict (type inference) typing system. Go does not support out of the box Object Oriented Programming experience, but is support structures (structs) which with the help of methods and pointers can help us achieve the OOP paradigm.
I came across an article one day, which stated that Go will be the server-side language of the future. I don’t deny that. Go has strong potential. However, Go is not a widely adopted language (as of 2018). Hence it’s hard to find Go related tutorials and learning resources on the web.
Hence, I have created this basic introduction to Go series which can help you understand the basics of the Go language. In this Run Go publication, you can find the basic tutorials of Go which focuses on internal workings of the language and language specifications.
The primary focus of these tutorial series will be to understand the basics of Go through small examples (through attached code snippets).