1

Hello everyone, I am fried fish.

Everyone usually uses the Go language, and in the past there have been C, C++, Java, and PHP. Why are the big guys at Google developing a new language?

Is it possible to make wheels, and other languages are not fragrant?

background

The Go programming language was conceived in late 2007 to solve some of the problems encountered when developing software infrastructure at Google.

Go 语言之父

The three people on the picture are the original designers of the Go language, and they are all very powerful.

  • Robert Griesemer: Participated in the development of Google's V8 JavaScript engine and Java HotSpot virtual machine.
  • Rob Pike: One of the early developers of the Unix operating system, one of the founders of UTF-8, and the designer of the Go language mascot is Rob Pike's daughter-in-law.
  • Ken Thompson: Turing Award winner, one of the early developers of the Unix operating system, one of the founders of UTF-8, and the designer of the C language (formerly the B language).

problems encountered

In the early interviews, Google bosses felt that "programming" was too troublesome, they didn't like C++ very much, and they were frustrated with the language and environment they are working in now, full of many features that are not very easy to use.

specific problems encountered. as follows:

  • Complex software: The problems caused by multi-core processors, network systems, large-scale computing clusters, and network programming models can only be temporarily circumvented and cannot be solved head-on.
  • Software scale: Software scale has also changed, today's server programs consist of tens of millions of lines of code, worked by hundreds or even thousands of programmers, and are updated every day (Go is said to be waiting for 45 minutes to compile) figured out).
  • Compilation time: In large compilation clusters, build times also extend to minutes, or even hours.

aim of design

In order to achieve the above goals, many fundamental problems need to be solved if the existing language is transformed, so a new language is required.

The new language needs to meet the following requirements:

  • Purpose: designed and developed Go to be able to work more efficiently in this environment .
  • Design: In the design of Go, except for the more well-known aspects: such as built-in concurrency and garbage collection. Also considered: strict dependency management, adaptability of software architecture as the system evolves, and robustness across boundaries between components.

This new language is now Go.

Go on Google

Go is a programming language designed by Google to help solve Google's problems, and Google's problems are huge.

Google's overall application software is huge, the hardware is huge, there are millions of lines of software, the server is mainly C++ language, and the other parts are a lot of Java and Python.

Thousands of engineers work on the code, on the "head" of a single tree that consists of all the software, so major changes are made to all levels of that tree every day.

A large custom-designed distributed build system makes development of this scale feasible, but it's still large.

Of course, all of this software runs on billions of machines, which are seen as a small number of independent, networked computing clusters.

In short, Google's development is large, can be slow, and is often unwieldy. But it works.

The Go project's goal: to remove the slow and unwieldy nature of Google's software development, thereby making the process more productive and scalable. language designed by and for people who write, read, debug, and maintain large software systems .

So the purpose of Go is not to study programming language design, but to improve the working environment of its designers and their colleagues.

Go is more about software engineering than programming language research. Or to put it another way, it's language design for software engineering.

Pain points

When Go was released, some people claimed that it lacked specific features or methods that were considered necessary for a modern language. How can Go be of any value in the absence of these facilities?

Our answer: Go has features that solve the problems that make large-scale software development difficult.

These questions include:

  • Build is slow.
  • Uncontrolled dependencies.
  • Each programmer uses a different subset of languages.
  • Poor understanding of the program (poor code readability, incomplete documentation, etc.).
  • Repetitiveness of work.
  • The cost of updating.
  • Version skew.
  • Difficulty writing autotools.
  • Build across languages.

A single feature of a pure language does not solve these problems, and we need to take a larger view of software engineering. So in the design of Go, we tried to focus on solutions to these problems.

Summarize

Software engineering guided the design of Go.

In contrast to most general-purpose programming languages, Go was designed to solve a range of software engineering problems we encounter when building large server software. This can make Go sound rather dull and industrial.

But in fact, the focus on clarity, simplicity, and composability throughout the design process instead resulted in an efficient, fun language that many programmers found expressive and powerful.

The resulting Go features for this include:

  • Clear dependencies.
  • Clear syntax.
  • clear semantics.
  • Composition relative to inheritance.
  • The simplicity provided by the programming model (garbage collection, concurrency).
  • Simple tools (Go tools, gofmt, godoc, gofix).

That's why Go was developed, and why it has such a design and features.

Have you learned it? :)

If you have any questions, welcome to feedback and exchange in the comment area. The best relationship between . Your likes is Fried Fish create, thank you for your support.

The article is updated continuously, you can read it on search [Brain fried fish], this article 161e79adda88ab GitHub github.com/eddycjy/blog has been included, to learn Go language, you can see Go learning map and route , welcome to Star.

refer to


煎鱼
8.4k 声望12.8k 粉丝