Home > Backend Development > Golang > Can go language be used for programming?

Can go language be used for programming?

青灯夜游
Release: 2022-12-27 10:30:42
Original
4363 people have browsed it

Go language can be programmed. Go language is a statically strongly typed, compiled, concurrent programming language with garbage collection function developed by Google. Go language has many uses and can be used for network programming, system programming, concurrent programming, and distributed programming. As a server programming language, Go language is very suitable for processing logs, data packaging, virtual machine processing, file systems, distributed systems, database agents, etc. It can also be used for network programming such as Web applications, API applications, and download applications.

Can go language be used for programming?

The operating environment of this tutorial: Windows 7 system, GO version 1.18, Dell G3 computer.

The Go language, also known as Golang, is a statically strongly typed, compiled, concurrent, and garbage collection programming language developed by Google.

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

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

  • Server programming, if you used C or C to do those things before, use Go It is very suitable for doing things such as log processing, data packaging, virtual machine processing, file systems, etc.

  • Distributed systems, database agents, middleware, etc., such as Etcd.

  • Network programming, this area is currently the most widely used, including Web applications, API applications, download applications, and Go’s built-in net/http package basically integrates the network functions we usually use All realized.

The launch of the Go language aims to reduce the complexity of the code without losing application performance. It has "simple deployment, good concurrency, good language design, and good execution performance" At present, many domestic IT companies have adopted Go language to develop projects.

Many important open source projects are developed using the Go language, including Docker, Go-Ethereum, Thrraform and Kubernetes.

Which companies or projects at home and abroad use Go language

After Go was released, many companies, especially cloud computing companies, began to use Go for reconstruction Many of their infrastructures are developed directly using Go. The recently popular Docker is developed using Go.

There are many open source projects developed using Go language. Early Go language open source projects only implemented C language library binding between Go language and traditional projects, such as Qt, Sqlite, etc.; many later projects used Go language for re-native implementation. This process is simpler than other languages. This has also contributed to the emergence of a large number of native development projects using the Go language.

  • Cloud computing infrastructure field

    Representative projects: docker, kubernetes, etcd, consul, cloudflare CDN, Qiniu cloud storage, etc.

  • Basic software

    Representative projects: tidb, influxdb, cockroachdb, etc.

  • Microservice

    Representative projects: go-kit, micro, typhon of monzo bank, bilibili, etc.

  • Internet infrastructure

    Representative projects: Ethereum, hyperledger, etc.

## Some foreign companies that use Go, such as Google, Docker, Apple, Cloud Foundry, CloudFlare, Couchbase, CoreOS, Dropbox, MongoDB, AWS and other companies;

Domestic companies that use Go development: Such as Alibaba Cloud CDN, Baidu, Xiaomi, Qiniu, PingCAP, Huawei, Kingsoft, Cheetah Mobile, Ele.me and other companies.

Can go language be used for programming?

Docker

Docker is a virtualization technology at the operating system level that can Isolation between them can also be called containers. Docker can quickly run one or more instances on a physical server. A virtual packaging tool based on lxc can realize the construction of PAAS platform. For example, start a CentOS operating system and end it after executing instructions on its internal command line. The entire process is as efficient as the operating system itself.

go language

The early source code of the Go language itself was written in C language and assembly language. Starting from Go 1.5 version, it is completely written in Go language itself. The source code of the Go language is of great reference significance for understanding the underlying scheduling of the Go language. Readers who want to have an in-depth understanding of the Go language are recommended to read it.

Kubernetes

A container scheduling service built on Docker developed by Google. Users can manage cloud container clusters through Kubernetes clusters.

etcd

A distributed, reliable KV storage system that can be quickly configured in the cloud.

beego

Beego is a Python-like Tornado framework that adopts the RESTFul design idea and is an extremely lightweight, highly scalable and high-performance web application framework written in Go language.

martini

A web framework for quickly building modular web applications.

codis

Excellent domestic distributed Redis solution.

delve

The powerful debugger of Go language is integrated by many integrated environments and editors.

Facebook

# Facebook also uses it. For this reason, they have also established an open source organization facebookgo on Github. You can view Facebook’s open source projects by visiting, such as The famous one is the smooth upgrade grace.

Tencent

As a large domestic company, Tencent still dares to try, especially in the field of Docker containerization. In 15 years, they have built tens of thousands of Docker units. For specific practices, please refer to

http://www.infoq.com/cn/articles/tencent-millions-scale-docker-application-practice

Baidu

The currently known use of Baidu is on the operation and maintenance side. It is a BFE project of Baidu operation and maintenance, responsible for the access of front-end traffic. Their person in charge shared something in 2016. You can take a look at this http://www.infoq.com/cn/presentations/application-of-golang-in-baidu-frontend

The second one is Baidu’s Messaging system. Responsible for the development and maintenance of the server side of the company's mobile messaging system.

JD

JD Cloud message push system, cloud storage, and JD Mall all use Go for development.

Xiaomi

Xiaomi’s support for Golang is nothing more than the open source operation and maintenance monitoring system, which is http://open-falcon.com/.

In addition, teams such as Xiaomi Interactive Entertainment, Xiaomi Mall, Xiaomi Video, and Xiaomi Ecological Chain are all using Golang.

360

360 also uses Golang a lot. One is the open source log search system Poseidon, hosted on Github,

and 360’s push team is also using it, and they also wrote a blog post on Golang’s official blog.

Meituan

Meituan background traffic support program. Scope of application: Support the backend traffic of the main website (sorting, recommendation, search, etc.), provide load balancing, cache, fault tolerance, conditional distribution, statistical operation indicators (qps, latency) and other functions.

Didi

Basic service platform.

金山微看

Application scope: service interface, background process service, message system, picture system

Sogou

Sogou push system. The part of the Push system used to maintain connections with clients.

. . . . .

Written at the end

Of course, whether a technology can be developed depends on three key points. (The following views are quoted from https://www.cnblogs.com/qwangxiao/p/8318894.html)

• Is there a better community? The ecosystems of C, C++, Java, Python and JavaScript are all very rich and popular. Especially communities with many commercial organizations participating are even more popular, such as the Linux community.

• Is there an industrial standard? C, C++, and Java all have standardized organizations. Java, in particular, has developed enterprise-level standards like J2EE in terms of architecture.

• Is there one or more killer apps? Needless to say, the killer applications of C, C and Java, even for PHP, which is not a good programming language, are key technologies in LAMP, the first killer solution in the Linux era, so, also developed. The above three points are very critical. New technologies only need to account for one or two of them to be very good. What's more, some technologies, such as Java, account for all three points. Therefore, the development of Java is so good.

Of course, in addition to the above three important points, there are also other influencing factors, such as:

  • Whether the learning curve is low and whether it is fast to get started. This is very important, and C is getting worse and worse at this point.
  • Is there a good development framework to improve development efficiency. Such as: Java's Spring framework, C's STL, etc.
  • Whether it is backed by one or more giant technology companies. For example: IBM and Sun behind Java and Linux...
  • Have they solved the pain points in software development. For example: Java solves the memory management problems of C and C.

Using these rulers to measure the Go language, we can clearly see:

  • The Go language is easy to get started;

  • The Go language solves the pain points of concurrent programming and low-level application development efficiency;

  • The Go language is backed by Google, a world-class technology company;

  • The killer application of Go language is Docker, and the Docker ecosystem has completely exploded in recent years.

So, the future of Go language is unlimited. Of course, Go may eat up many C, C, and Java projects. However, the main projects consumed by the Go language should be middle-layer projects, neither very low-level nor business layer. In other words, the Go language will not swallow up low-level projects such as C and C, nor will it swallow up high-level projects such as the Java business layer. What the Go language can devour must be projects on PaaS, such as some message caching middleware, service discovery, service agents, control systems, agents, log collection, etc. There are no complex business scenarios, and it cannot reach special bottom layers (such as operating systems). ), a software project or tool that is an intermediate platform layer. C and C will be moved to the lower level, and Java will be moved to the upper business layer.

Okay, let’s use the above ruler to measure Docker, the killer application of Go language, and you will find that it is basically the same.

  • Docker is easy to get started with.

  • Docker solves the environmental problems in operation and maintenance and the pain points of service scheduling.

  • Docker’s ecosystem has big companies behind it. Such as Google.

  • Docker produces the industry standard OCI.

  • Docker’s community and ecosystem have already seen a trend similar to that of Java and Linux.

[Related recommendations: Go video tutorial, Programming teaching

The above is the detailed content of Can go language be used for programming?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template