Home  >  Article  >  Backend Development  >  What kind of dynamic language is go?

What kind of dynamic language is go?

青灯夜游
青灯夜游Original
2020-12-09 16:45:313885browse

go is not a dynamic language, but a statically strongly typed, compiled language. GO is a statically typed language, but it has the feeling of a dynamic language. A statically typed language can detect most hidden problems during compilation. The feeling of a dynamic language is that there are many packages that can be used, and it is very efficient to write.

What kind of dynamic language is go?

Related recommendations: "go tutorial"

Go (also known as Golang) is a static tool developed by Google A programming language that is strongly typed, compiled, concurrent, and has garbage collection capabilities.

Go's syntax is close to C language, but the declaration of variables is different. Go supports garbage collection. Go's parallel model is based on Tony Hall's Communicating Sequential Process (CSP). Other languages ​​that adopt a similar model include Occam and Limbo, but it also has features of Pi operations, such as channel transmission. Plugin support is opened in version 1.8, which means that some functions can now be dynamically loaded from Go.

A statically typed language, but with the feeling of a dynamic language. A statically typed language means that most hidden problems can be checked out during compilation. The feeling of a dynamic language is that there are many packages that can be used and written. high efficiency.

Advantages of go language

  • #It can be directly compiled into machine code without relying on other libraries. The version of glibc has certain requirements, and deployment is just a matter of throwing it away Just upload one file and it's done.

  • A statically typed language, but it has the feeling of a dynamic language. A statically typed language can detect most of the hidden problems during compilation. The feeling of a dynamic language is that it has many packages. It can be used and is very efficient to write.

  • Supports concurrency at the language level. This is the biggest feature of Go, which inherently supports concurrency. Go supports concurrency in its genes. It can make full use of multiple cores and make it easy to use concurrency.

  • Built-in runtime supports garbage collection. This is one of the characteristics of dynamic languages. Although GC (memory garbage collection mechanism) is not perfect at present, it is enough to cope with what we can Most situations encountered, especially GC after Go1.1.

  • It is simple and easy to learn. The authors of Go language all have C genes, so Go naturally has C genes. Then Go keywords are 25, but the expression ability is very powerful, almost Supports most of the features you've seen in other languages: inheritance, overloading, objects, etc.

  • Rich standard library, Go currently has a large number of built-in libraries, especially the network library is very powerful.

  • Built-in powerful tools. There are many tool chains built into the Go language. The best one should be the gofmt tool, which automatically formats the code and makes team review so simple. Code The format is exactly the same, so it’s difficult to think of something different.

  • Cross-platform compilation. If the Go code you write does not contain cgo, then you can compile Linux applications on the window system. How to do it? Go references the code of plan9, which is information that does not depend on the system.

For more programming-related knowledge, please visit: Programming Learning! !

The above is the detailed content of What kind of dynamic language is go?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn