This page looks best with JavaScript enabled

Let's Learn Go -- (1) Background and Characteristics

 ·  ☕ 3 min read

1. The Background of the Go Language

The development of C/C++ did not keep pace with the advance of computing, and for over a decade no mainstream systems programming language suited to the era appeared. To solve this problem, Google developed a new programming language – Go.

Google’s situation at the time:

  • Projects mainly used C++, along with Java and Python
  • A huge number of developers
  • A massive codebase
  • Distributed compilation
  • Servers numbering in the millions

The problems Google faced at the time:

  • Slow compilation
  • Complex dependencies
  • Each engineer used only a portion of the features of one language
  • Code was hard to maintain, poorly readable, and badly documented
  • The cost of changing functionality kept growing
  • Cross-compilation was difficult

Google’s original intent in designing Go was to eliminate various kinds of slowness and cumbersomeness, and to improve efficiency and scalability. Go is aimed mainly at people who develop large systems, and it emphasizes solving engineering problems.

Google started the Go project in 2007, open-sourced it in 2009, and released the first official version in 2012, with a new version every six months thereafter. Inside Google, Go initially ran as a 20% project, meaning employees contributed using 20% of their spare time.

The three main leaders of the Go project all had a deep understanding of systems programming languages, operating systems, and concurrency:

  • Rob Pike, author of Unix, UTF-8, and Plan9
  • Ken Thompson, author of the B and C languages, and the father of Unix.
  • Robert Griesemer, who took part in developing the JavaScript execution engine V8, the Java HotSpot virtual machine, and more.

Such a strong founding team, together with the halo of being made by Google, brought the Go project enormous popularity.

2. Where Go Fits

Some scenarios Go is suited to:

  • Server programming, handling logs, data packaging, virtual machine processing, file systems, and more
  • Distributed systems, database proxies, middleware, and more
  • Network programming, web applications, API applications, download applications, game backends, and more
  • Massive storage, InfluxDB, TiDB, and more
  • Cloud platforms, CloudFoundry, and more

Overseas companies using Go include Google, Docker, Apple, Cloud Foundry, CloudFlare, Couchbase, CoreOS, Dropbox, MongoDB, and AWS.

Domestic companies using Go include Toutiao, Alibaba Cloud CDN, Baidu, Xiaomi, Qiniu, PingCAP, Huawei, Kingsoft, Cheetah Mobile, and Ele.me.

3. Characteristics of the Go Language

Go, also known as Golang, is a statically and strongly typed, compiled, concurrent programming language with garbage collection, developed by Google. Many of Google’s engineers come from the C family, so Go belongs to the C family along with C++, Java, and C#.

In its declaration and package design, Go was influenced by the Pascal, Modula, and Oberon family of languages; in its concurrency design, Go drew some lessons from the practice of Limbo and Newsqueak, which were likewise influenced by Tony Hoare’s Communicating Sequential Processes (CSP) theory, and it uses mechanisms similar to those of Erlang.

The advantages of the Go language:

  • Simple deployment: after compilation it is a static executable with no external dependencies apart from glibc
  • Good concurrency: Goroutine and Channel support concurrency at the language level, so writing highly concurrent applications does not require considering locking mechanisms and the various problems they bring
  • Good language design with a complete built-in toolchain, for example gofmt can automatically format code
  • Good execution performance, suitable for writing bottleneck workloads, and very memory-efficient
  • A rich standard library with a large number of built-in libraries that can be used directly

WeChat Official Account
WRITTEN BY
WeChat Official Account