The history of Go
Go is an open-source programming language that makes it easy to build software that is simple, reliable, and efficient.
Go was developed from the end of 2007 by Robert Griesemer, Rob Pike, Ken Thompson, and later joined Ian Lance Taylor, Russ Cox, and eventually open source in November 2009, A stable version of Go 1 was released earlier in 2012. Now the go development is completely open and has an active community.
Current industry background
Computers have been evolving, but programming languages have not evolved at the same rate. Mobile phones now have a built-in CPU count of more than the first computer we use. High-performance servers have 64 cores, 128 cores, and even more cores. But we are still using the technology for single-core design in programming.
The technology of programming is also evolving. Most programs are no longer done by a single developer, but by a group of people working in different time zones and at different times. Large projects are broken down into small projects, assigned to different programmers, developed by programmers, and submitted to the entire team in the form of libraries or packages that can be cross-used across applications.
Today's programmers and companies are more trusting of the power of open source software than ever before. The go language is a programming language that makes code sharing easier. The go language comes with tools that make it easier to use other people to write packages, and the go language makes it easier to share your own packages.
Go solves modern programming challenges
The Go language development team took a long time to solve the problems faced by today's software developers. Developers have to choose between rapid development and performance when choosing a language for a project. Languages such as C and C + + provide fast execution speed, while languages like Ruby, PHP, and Python specialize in rapid development. The go language is a bridge between the two, providing not only high-performance languages, but also faster development.
As a language, go defines what you can do and what you can't do. The grammar of the Go language is concise to only a few keywords, easy to remember. The go language compiler is very fast, and sometimes even makes people feel less compiled. As a result, go developers can significantly reduce the time it takes to wait for a project to build. Because the go language has a built-in concurrency mechanism, it is not forced to use a specific thread libraries, allowing the software to expand and use more resources. The Go language type system is simple and efficient and does not require an extra mind for object-oriented development, allowing developers to focus on code reuse. The go language also comes with a garbage collector, which does not require the user to manage the memory themselves. Let's take a quick look at these key features (of course, the go garbage collection mechanism is not as powerful as the Java language, although developers are threatening to catch up with the JVM garbage collection mechanism, let's wait and see.) As of the time I post this blog: 2017-03-16 22:13:42 version has been upgraded to 1.8)
Full utilization of resources
As programmers, it's hard to develop an application that takes full advantage of hardware resources. Modern computers have multiple cores, but most programming languages do not have effective tools to make it easy for programs to take advantage of these resources. These languages need to write a lot of thread synchronization code to take advantage of multiple cores, which can easily lead to errors.
The go language support for concurrency is one of the most important features of this language. Goroutine is much like a thread, but it consumes far less memory than a thread, and requires less code to use it. Channel is a built-in data structure that allows users to synchronously send messages of the same type between different goroutine. This makes the programming model more inclined to send messages between goroutine, rather than having multiple goroutine competing for the same data usage.
Go language Uses
The Go language is designed as a system programming language for a giant central server that is powered by a WEB server that stores clusters or similar applications.
In the field of high-performance distributed systems, the Go language is undoubtedly more efficient than most other languages. It provides a huge amount of parallel support, which is great for the development of the game server.
First GO Program
Next, we will write all the beginner program printing program, print: Hello world!. Hello.go (the extension of the Go Language source file is. Go), the code is as follows:
" FMT " Func Main () { fmt. Println ("Hello, world! "
The result of the above code operation is as follows:
Go run Hello.gohello,world!
Go_00:go language Begins