Go language design and implementation

History and Present Situation

Go is a programming language born in 2009. It has been more than 10 years since its development. At present, Go language is very popular in the community at home and abroad. Many well-known open source frameworks, such as Kubernetes, ETCD and Prometheus, are developed using Go language. In recent years, popular micro-service architecture and cloud native technology have also brought a lot of vitality to Go language community.

Figure 1 – Go language

At present, the author also uses Go language as the main language for daily development. Although Go language does not have the development efficiency and powerful expression ability of Lisp languages, it is a very easy to use and large-scale application of engineering language, which is also the main reason for the author to learn and use Go language.

The author began to learn and use Go language in 2018. When he first came into contact with Go language, he rejected and rejected it. He once thought that the design of GOPATH was very strange, and the simple grammar also led to low expression ability and affected development efficiency. However, with the in-depth study and understanding of the Go language, the author’s concept of this is constantly changing.

Today, the author thinks that we need in industry a grammar simple compiled language, so it can provide simple and abstract concept, although the language also has a lot of problems at present, but the continuous improvement of the language and computer-aided tools also let the author feel the vitality of the community, and firmly believe that the language of the future development of the more the better.

Why write this book

At present, there are few books on the market analyzing the implementation of Go language, and most of them focus on the basis and actual combat of Go language. There are many blogs analyzing Go, but they all face two problems:

  • Many blogs show implementation details of source code in paragraphs that do not provide good readability;
  • A few blogs are of high quality. They explain some modules of Go language in depth, but they are not systematic enough to form rich and complete content.

In addition to these reasons, blogs and books on the design and evolution of Go are rare, but understanding the history of Go is an effective way to help us understand the language, and we should not ignore this process.

Writing ideas

Books analyzing language design and implementation are not particularly easy to write. Many articles get bogged down in unimportant details, a lot of pages are copied from source code, and the process of analyzing introductions is not prioritized and does not provide a good reading experience. This book will provide readers with high quality content based on the following concepts:

  • Lots of illustrations to help readers understand the implementation details;
  • Understand the decisions and reasons behind the design through historical evolution and community discussion;
  • Eliminate extraneous details in source code and provide accurate source links;
  • Provide a practical way to read the source code;

The author will help readers understand the design and implementation of Go language through the above different means.

The target readers

This book is not recommended for readers who have no programming experience. Its target audience is:

  • Developers who have learned the Go language and want to understand the design and implementation behind it;
  • Developers who have experience in other languages and want to learn Go;

The main content

The main content of this book can be divided into four main parts, namely compilation principle, runtime, basic knowledge and advanced knowledge. These four parts can cover almost all aspects of Go language from compilation to operation, so that we can have a more overall and profound understanding of Go language. The main content of the book is shown in the following thought guide:

Figure 2-Go language design and implementation main content

By reading this book, you can gain an in-depth understanding of the design and implementation of the Go language, including but not limited to the following:

  • Understand compiler lexical and syntax parsing, type checking, intermediate code generation, and machine code generation.
  • Understand the internal representation of data structures such as arrays, slicing, hash tables and strings and the principles of common operations;
  • Understand functions, methods and reflection in Go.
  • Understand common concurrency primitivesMutex,WaitGroupAnd the use and principle of extension primitives;
  • Understand the implementation of keywords like make, new, defer, select, for, and range;
  • Understand the implementation principles of scheduler, network poller, memory allocator and garbage collector at runtime.
  • Understand the design and principle of HTTP, RPC, JSON and other standard libraries;

Interaction and erratum

If you have questions about this article or would like to contact the author, you can leave a message on draVENESS. Me/Golang /, and the author will respond within 24 hours. If you are unable to answer questions, you can also leave a message via 👀.


  1. What is the history of the project? Golang.org/doc/faq#his… ↩ ︎