Compare Erlang and Golang

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Rainy Weekend, suitable for the season of the code word ...

I started studying a year ago . Go language, unsanitary environment, both python coding efficiency and performance. the Times to ascend. Especially in the area of asynchronous programming, you can use channel synchronization threads, without locking can make full use of CPU Multi-core computing, there is no weakness.

 

then slowly learned that the idea of this kind of unlocked asynchronous programming stems from a door called Erlang 's language, Erlang more remarkable. In addition to asynchronous programming, the language natively supports distributed, software developed on a single machine that can run unmodified on a cluster, and also supports a hot upgrade of the software version, with its own OTP framework that supports monitoring and rebooting between processes, providing a rock-solid operating environment. Erlang is so perfect, I think it is the most suitable language for developing Internet applications, and for a time there is the joy of "finally finding the truth".

 

but at that time, the heart always feel there is something wrong, that is, seven cattle CEO Xu Xiwei itself is Erlang Master, he chose for his company. Go language, seven kn became a only use Go language for the development of the company.

 

In recent days with erlang erlang essence is a dynamic language, Its dynamic type, dynamic function calls, are fully expressive of the characteristics of dynamic languages. erlang is a running in the virtual machine inside the dynamic language, in fact, it is not surprising, only dynamic language, it is easy to achieve the software version of the hot upgrade. What is the disadvantage of dynamic language, is slow, dynamic language because of the time to type deduction, execution speed is more than static language several times, so, erlang c language implementation, integrated into erlang

 

so Erlang the scenarios that apply are high concurrency and low compute density, such as WhatsApp , using Erlang write, tens of thousands of users at the same time, high concurrency of the typical scenario, but users send messages are not dense, how fast a person can type, this scene is particularly suitable for Erlang .

 

Xu Xiwei Long understood, seven cattle to provide the picture cloud storage, always need a large disk IO , picture real-time scaling requires a lot CPU compute, select static Language Go language that can improve performance and reduce server purchases.

 

"In the world, the law of security , Do not bear the Buddha ", high concurrency and dense calculation is actually a pair of contradictions, when CPU services for dense computing, naturally flawless response to more requests. Of course, you can use Erlang to build an Internet service, respond to requests with high concurrency, and then transfer the computation to a CPU - free node, but those compute nodes, if used in a static language (such as Go language) for better performance.

 

in the design of the software, the microscopic, to identify which can be concurrent, which must be serial. On the macro level, you want to identify which IO is dense and which are computationally intensive. There is never a standard answer, it is the charm of this industry.

 

Comparison Summary:

Erlang the advantages of which the 2,3,4 and no other language can rival

1. High concurrency, the originator of asynchronous programming, writing concurrency code is simple

2. Support cluster

3. Robust (OTP process monitoring mechanism)

4. code hot upgrade, hot rollback

 

Go Language ( Scala , F # similar) advantages,

1. High concurrency, supports asynchronous programming

2.< Span style= "font-size:7pt;font-family: ' Times New Roman '; line-height:normal;" >         high performance (static language advantage)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.