GoLanguage Introduce


本文中文版链接:https://docs.google.com/document/d/1-VHX-_dRtw1NXfbm-h2__7TlxnEDkz8iLHPydKufqGo

The Go language (or Golang) originated in 2007, was created by Google, and was officially released in 2009. Go is a very young language, and its main goal is "to combine the speed of development of dynamic languages ​​such as Python with the performance and security of compiled languages ​​such as C / C ++".

  Go is another attempt at programming language design. It is a major improvement on C-like languages. It not only gives you access to the operating system, but also provides powerful network programming and concurrent programming support. The Go language has many uses, and can be used for network programming, system programming, concurrent programming, and distributed programming.

  The launch of Go language predicts to reduce the complexity of the code without losing the performance of the application. It has the advantages of “simple deployment, good concurrency, good language design, and good execution performance. project.

  Go is sometimes described as "C-like language" or "C language for the 21st century." Go inherited a lot of ideas from C language, similar expression syntax, control flow structure, basic data types, call parameters and values, pointers, etc., as well as the efficiency of compiled machine code that C language has always liked and the existing Seamless adaptation of the operating system.

  Because Go has no concept of classes and inheritance, it does not look the same as Java or C ++. But it implements polymorphism through the concept of interfaces. Go has a clear and understandable lightweight type system, and there is no hierarchy between types. So it can be said that Go is a mixed language.

  In addition, many important open source projects are developed in Go, including Docker, Go-Ethereum, Thrraform, and Kubernetes.
  Founder of Go

  When evaluating languages, it is important to understand the motivations of the designer and the problems the language will solve. Go comes from Ken Thompson and Rob Pike, Robert Griesemer, who are all heavyweights in computer science.
  1) Ken Thompson

  A member of Bell Labs' Unix team, one of the founders of C, Unix, and Plan 9, designed and implemented the original UNIX operating system in the 1970s, and from this point alone, how his contribution to computer science can be leveraged The effect is not excessive. He also collaborated with Rob Pike on the UTF-8 encoding scheme.
  2) Rob Parker

  The head of the Go language project and a member of the Unix team at Bell Labs. In addition to helping design UTF-8, he also helped develop the distributed multi-user operating system Plan 9, Inferno operating system and the Limbo programming language. "Unix Programming Environment" gives an orthodox explanation of the design philosophy of UNIX.
  3) Robert Grisemer

  Worked at Google, participated in the development of the Java HotSpot virtual machine, has a deep understanding of language design, and is responsible for the code generation part of the Google V8 JavaScript engine used by Chrome browser and Node.js.

  These heavyweights in computer science have designed the Go language to meet Google's needs. Designing the language took two years, integrating the team's years of experience and deep knowledge of programming language design. The design wisdom of Pascal, Oberon, and C, while making Go a convenience for dynamic languages. Therefore, Go language embodies the language design concept of experienced computer scientists and is designed for one of the world's largest Internet companies.

  All Go designers say that Go was designed because C ++ gave them a sense of frustration. At a Google I / O 2012 Go design team meeting, Rob Pike put it this way:
  We do C ++ development, and we are tired of waiting for compilation to complete. This is even a joke, but in fact it is true.
  Go is a compiled language

  Go to Compiling code with a compiler. The compiler compiles the source code into a binary (or bytecode) format; when compiling the code, the compiler checks for errors, optimizes performance, and outputs binary files that can run on different platforms. To create and run a Go program, the programmer must perform the following steps.
  Create a Go program using a text editor;
  save document;
  Compile the program
  Run the compiled recombination file.

  This is languages ​​such as Python, Ruby, and JavaScript, which do not include compilation steps. Go comes with a compiler, so there is no need to install a separate compiler.
  Why learn Go

  If you want to create system programs or web-based programs, Go is a good choice. As a relatively new language, it is designed by experienced and respected computer scientists to address the challenges of creating large, concurrent network programs.

  Before the advent of the Go language, developers always faced very difficult alternatives. In fact, they used languages ​​with fast execution speed but not ideal compilation speed (such as C ++), or faster compilation speed but inefficient execution. A good language (such as: .NET, Java), or a development language that doesn't perform as fast as a dynamic language? ? Go has achieved the best balance between these three conditions: fast compilation, efficient execution, and easy development.

  The Go language supports cross-compilation. It can be said that you can develop applications that can run on Windows on a computer with Linux system. This is the first programming language that fully supports UTF-8. This can be used to process strings encoded using UTF-8, and even its binary file format uses UTF-8 encoding. Go is truly international!

评论