Permalink to this article – https://ift.tt/mKW7HCw
When you get started with the Go language, you are mostly immersed in the Go grammar, busy practicing or quickly completing the company’s projects, and have no time to think.
But when everyone is about to advance and sprint to the advanced stage, I suggest that you stop being confused. Now that we have entered the pit of Go, before entering the advanced stage, we’d better stay in front of the “shadow wall” at the door.
Think carefully about why Go, which we have invested so much energy in research, can succeed , and whether it can continue to succeed in the future. You must have your own basic judgment, whether it is self-suggestion or firm confidence, we must accumulate energy for continuing to climb the peak of Go .
1. Brainstorm the success factors of Go
I believe that no matter which gopher group is brainstorming, let everyone list the factors of Go’s success, and everyone’s mainstream answers are nothing more than the following:
The various factors in the figure are not unrelated to the success of Go, but which one or which ones are decisive?
2. The fundamental factors of Go’s success
Obviously, there is no standard answer to this question, and different people have different opinions. Here I list my views for your reference.
Going straight to the conclusion, I think there is only one fundamental factor for Go’s success: Google .
Why do you say that? Let’s expand to see below (see picture below)!
I compare the Go community to an army, and Go is the weapon of the Go community, fighting against other programming languages and occupying territory (fans). Let’s deconstruct the composition of this army and why there are so many successful cases in this army!
1. Google provides the Go community with commanders and weapons
As we all know, in 2007, three Google employees, Robert Griesemer, Rob Pike, and Ken Thompson (retired early, spiritual leader, and gave Go a reputational endorsement) jointly invented the Go language. After Go was open sourced in 2009, the Go community gradually formed. Commanders are the soul of an army, they make the first and most important decisions that affect Go and the Go community and the Go design philosophy behind it!
a) design decisions
In 2022, the Go team published a paper: ” Go Programming Language and Environment ” in the Journal of Communications of the ACM, which gave a detailed description of the many decisions made that year. Here are two of the most important ones. Brief explanation of the decision:
- Go aims to be a programming environment
The fathers of the Go language believed that language features are only part of the programming language, and that programming environment features are as important as language features. These environment features include: libraries, tools, conventions, and overall practices for software engineering. Support is provided and indispensable. And these environmental characteristics are just not given due attention in the traditional programming language design.
Such a decision allowed Go to provide developers with almost everything needed for programming in Go at the beginning of open source: including feature-rich, out-of-the-box standard libraries and comprehensive tool sets, code formatting, code static checking, Dependency management, construction (including cross-platform cross-compilation), testing, performance analysis, viewing and generating documents, etc., and these tool sets are all placed under the go command today. This decision also helped Go attract the first batch of Go community users after it was open sourced.
- Consistent performance in Go
One goal of Go is to have it behave the same across different implementations, execution environments, and even at different times . Therefore, the Go language specifies consistent results as much as possible. For example: consistent performance in the life cycle of Go programs (compared to languages using JIT slow start), consistent GC overhead, etc. Provides well-defined semantics for even the most common programming errors, which facilitates understandability and debugging, rather than being riddled with undefined behavior as in C/C++.
And I think the most important consistency is that since Go 1.0 was released in 2012, the Go team has made a public commitment to only make backward compatible changes to the language and standard library , so that programs will continue to run when compiled to newer Go versions without changing. This commitment is attractive to the industry, encouraging not only those engineering projects with long statement cycles (such as some large projects within Google or top-level projects in the community like Kubernetes), but also other efforts such as books, training courses and a thriving ecosystem of third-party software packages. This consistent decision also recruited a considerable number of fans for Go. Go1 compatibility can also avoid community splits (like python2/python3). Even the most changed generic syntax in more than 10 years has not violated Go1 compatibility, which is not easy.
b) Design Philosophy
Behind the above design decisions lies the design philosophy of the fathers of the Go language.
- Simple
Tony Hoare put it this way in his Turing Award speech in 1980: “My conclusion is that there are two ways of constructing a software design: one way is to make it so simple that it is obviously free from defects, and the other way is to Make it so complex that there are no obvious flaws. The first method is much more difficult. It requires the same skill, dedication, insight, and even inspiration as discovering the simple laws of physics that underlie complex phenomena in nature .It also requires a willingness to accept goals that are limited by physics, logic, and technology, and to accept compromises when conflicting goals cannot be achieved.”
Go chose the very first design method for building software in Tony Hoare’s evolution. Rob Pike’s popular Go proverb “less is exponentially more” is similar to this. Go’s simple syntax and simple API provide great convenience for Gopher, but behind these simplicity is the Go team’s long-term and complex thinking and implementation, trying to simplify the syntax and API to the smallest, most useful, and closest to the essence hard work.
At the same time, simplicity means readability, maintainability, and clarity of code. Another Go proverb “Clear is better than clever” warns Gophers to write plain Go code to be “politically correct” and not to show off their skills.
- concurrency
In the multi-core era, Go uses concurrency as a built-in feature of the language. Go has built-in concurrency primitives, including goroutine, channel, select, etc.
Go encourages the use of concurrency at a high level, especially through communication. A Go proverb that we are familiar with is “Don’t communicate by sharing memory. Share memory by communicating” is the external embodiment of concurrent philosophy.
- combination
Go has types, and types can have methods. This seems to be an implementation of object-oriented style, but Go does not have a type hierarchy like OO languages. In Go, composition is the connection between Go types The most important means, and interface and type embedding are the concrete embodiment of this combination philosophy.
- Engineering-oriented
In 2012, the first year of Go open source, Rob Pike gave a speech on “Google’s Go: Language Design for Software Engineering” at the SPLASH 2012 conference, explaining how Go is targeted around the software engineering problems existing within Google. language design. It can be seen that Go has set solving problems in the field of software engineering as the goal of the language since its birth. At the same time, we see that the engineering-oriented philosophy is tied to the above decision to be a programming environment.
In addition to the commander in chief, the governance structure of the Go community is also centered on Google’s “generals”. Let’s continue to look at it.
2. Google pays: Go community governance structure centered on Google “generals” (googler and ex-googler)
Go has been open source for 10 years. The Go community has formed a Go community governance structure centered on Googler and ex-googler (former Google employees). These people are the “generals” in the above picture, and they are a subdivision of the Go project. , such as: the leader of compiler, runtime goroutine scheduling, GC, memory management, network, security, etc. According to the description of a product manager of the Go project: In 2021, there will be more than 50 full-time staff in the Google Go project. Here, it is good to have a rich “father” .
This architecture with googler and Ex-googler as the core of open source community governance determines that the Go community adopts a decision-making mechanism that I call “democratic centralism”. In the Go community, you should not imagine that there will be absolutely fair voting. Go project decisions have always been dominated by a small number of Googlers and ex-googlers. This means that in many cases, the proposals proposed by the core governance team and Google’s internal gophers are easy to be accepted, but it may be more difficult for proposals from external communities to be accepted. how to say? Google’s solution may not always be the best, but we have to admit that in most cases, the proposals proposed by Googler are still better, and usually the implementations corresponding to these proposals have been tested internally by Google, and even made decisions with Go The group has “blown the wind” within the company. If you were a decision-maker in the Go community, what would you do? Do you trust Googler more or an outside gopher without any background?
I think this mechanism may still be conducive to the vigorous development of Go when Google is still leading the IT frontier today and in the next few years.
3. Google provides a battlefield/testing ground for the Go community
As mentioned above, Go is a programming language with a very distinct Google brand. In addition to the fact that the father of the Go language comes from Google, and the core of the Go community governance structure comes from Google and former Google employees, Google provides internal support for the design of Go It provides enough first-class problem domains, and also provides a testing ground and a real battlefield for the real application of Go , even if Go has not become the first language inside Google. First-hand and first-class problem domains for Google, so that Go designers and Go developers can get first-hand feedback to further polish Go.
To give a few examples:
- Google’s internal single code repository allowed Go to initially design go get without a version (later the go module was introduced under the strong request of the community, and go get only supported the version number);
- Feedback from googler, Google’s internal tools are super easy to use, which to a certain extent made the Go team realize the importance of providing Gopher with a complete go tool chain;
- Google’s internal multi-core and network services made Go designers decide to build native goroutines to cope with application development in the multi-core era;
- Google’s equal emphasis on performance and development efficiency led Go designers to decide to design a static programming language with gc, which sinks memory management and concurrency management to the runtime. This is consistent with the ideas of service grid, dapr and other concepts that have emerged in the past two years ;
- Large-scale personnel collaboration within Google made Go decide to face software engineering, not only to design language features, but also to provide a good programming environment (tool chain, standard library, etc.);
- The slow construction of Google’s ultra-large-scale system made Go decide to provide fast construction capabilities, so the package format and package dependencies have been carefully designed;
- Google’s internal long-term maintenance system (long life cycle) made the Go team decide to support Go1 compatibility and provide syntax that supports refactoring, such as type alias, etc.;
- Google believes that security is very important, prompting Go to provide go sumdb and good support for sbom;
At the same time, Google’s internal system also spares no effort to support Go’s internal experiments. For example, whenever Go releases a large version of the RC version, or even a Beta version, Google App Engine will be the first to act as a “guinea pig”. The production environment support has not yet been officially released. version of Go.
In addition, Google’s leadership in the industry also benefits Go, which is “close to the water”. For example, a platform such as container scheduling and orchestration, Google had it (borg) ten years ago, and Googlers subsequently spilled their experience in the form of another open source project. , Let Kubernetes finally choose Go as the development language, thus becoming the biggest and most typical successful case of Go.
To sum up, we can see that Google plays a decisive role in the success of Go, which can never be understood as simple monetary support.
3. Go language evolution history
After entering the advanced stage of Go, you need to know the evolution history of the Go language. Of course, it is better to be able to do it. Even if you can’t, you must remember the main evolution history of the Go language:
- In September 2007, the Go language was born;
- In November 2009, Go was officially open source;
- In March 2012, Go 1.0 was released, and the Go1 compatibility commitment was officially announced;
- In December 2014, the Go 1.4 version was released, which is the last version of the compiler and runtime implemented by the C language;
- In August 2015, Go 1.5 version was released. This version of Go realized bootstrapping (compiling go with go), and at the same time, most of the c code in the compiler and runtime was replaced with go. The new version of gc greatly reduced the delay;
- In August 2018, Go 1.11 was released, and the go module was officially introduced;
- In March 2022, Go version 1.18 was released, and the Go generic syntax officially landed.
4. Summary
The father of C++ said: “There are only two programming languages in the world: one is always complained about, and the other is never used”.
Go belongs to the former. There is no perfect programming language in the world. After ten years of polishing, Go has made great progress and achieved good results, especially in the field of cloud infrastructure and cloud native. Even Rob Pike admits that Go has indeed Become the language of cloud infrastructure . In the process of Go’s success, Google plays a fundamental role.
However, there is an old Chinese saying: success is Xiao He, and failure is Xiao He! At present, Google is still leading the forefront of IT technology, which is good for the development of Go, and will continue to promote the development of Go in a good direction.
But I boldly predict: “Success is also Google, and failure is also Google”. Once Google starts to decline, the foundation for the success of the Go language will no longer exist. Can Go still be as smooth as it is today? If the governance structure of the Go community is not restructured, it is likely that it will not be in such a good state today. What do you think?
V. References
– “Go Memory Model” – https://ift.tt/f3dpAFR
– “The Real Problem of Go Language” – https://ift.tt/RWvPkGl
“Gopher Tribe” knowledge planet aims to create a boutique Go learning and advanced community! First release of high-quality Go technical papers
Chapter, “Three Days” first-time reading rights, analysis of the development status of Go language twice a year, fresh Gopher Daily 1 hour in advance every day, online courses, technical columns, book content preview, must> answer guarantee within six hours, etc. to satisfy you All needs about the Go language ecology! In 2022, the Gopher tribe will be fully revised, and will continue to share knowledge, skills and practices in the Go language and Go application fields, and add many interactive
dynamic form. Everyone is welcome to join!
Gopher Daily (Gopher Daily News) archive repository – https://ift.tt/OMWj7mu
my contact information:
- Weibo (temporarily unavailable): https://ift.tt/i4E95Wb
- Weibo 2: https://ift.tt/mlpN9WH
- Blog: tonybai.com
- github: https://ift.tt/iQygZJF
Business cooperation methods: writing, publishing, training, online courses, partnerships, consulting, advertising cooperation.
© 2022, bigwhite . All rights reserved.
This article is transferred from https://tonybai.com/2022/12/07/why-go-succeed/
This site is only for collection, and the copyright belongs to the original author.