Erlang vs Golang, how to choose?

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.
   The first language I used was Java and Python, and I always had a crush on Python, and I liked the feeling of simplicity and efficiency, but I didn't use Python in the end, because it was simple, I just didn't like the indentation syntax, Just for a lot of people to change jobs just for the screen larger, and also have the same great option, this is Ruby, so I finally adopted Ruby as the main programming language, but also for the inability to use Python a little bit of a pity, after all, Python's robustness is much better than Ruby, It's just that Ruby has been making progress, so it's harmless. We all know that whether it's Python or Ruby, or even Java, it's all about solving business-level problems, application-oriented languages, and solving business logic, but there's a domain of systems, partial networks and underlying operations, In this piece I have been looking for an elegant solution, C + + was my first to eliminate, C's development efficiency is too low, Java is more appropriate, is too bloated, and the lack of system programming genes, after all, it is enterprise development origin of the last I chose Erlang, because it is excellent in the network layer performance, At the same time fault tolerance and robustness are very good, its virtual machine is the only one comparable to the JVM, but also the OTP super-heavyweight weapons, almost can be a Kill network layer application, but according to my summary it has a mishap and a soft rib, this point behind the expansion, It can be said that the choice of Erlang is what I currently know the solution is optimal until one day I learned Golang, I know that Golang is actually very early, about 08 years when Google is engaged in a strange language, after a few years, has been a lot of people in the old Mo as the representative of the Golang, in fact, I have not been too concerned about, I learned from the ROR experience is that the maturity of business is very important, and then based on the development of Golang products more and more, let me have to study, this I know, this is my dream of Python, The best balance of efficiency and performance, the more you learn about go, the less willing to write code in Erlang, the main reason: 1. Erlang's mishap lies in the readability and expressiveness of the code, let me give you a small example, for example, you build a restful interface for your system software, We have a general understanding of the Code style, not to mention Erlang, whether it is your C/c++/python/ruby/java origin, the go is not a very long-lost feeling, why is the mishap? Because for a language, grammar is not likely to be significantly changed, and there will be no big changes, I do not know if anyone read the "as Programming World", the rationale is very clear,The real good programming way is the person to dominate the computer rather than the computer dominate the person, I feel that Erlang is a bit master my sense of programming thinking (my eyesight itself is not good, it still constantly kills my eyes!) ), programming first is the door logic, followed by engineering, and finally mathematics, but also reminds me of Wu, "The Beauty of Mathematics," said, artificial intelligence in the past century has been detours, expect the height of the machine Turing complete, and ignore the human itself has a civilization, statistical induction of the application of 2, Erlang is a high-quality library less , although there are many killer applications, the same go in this area is a soft rib, this point for a less than five years of language can be original, but for a more than 20-year language is not a bit justified, such as you use JSON parsing library, many people are from mochiweb this basic not updated library to extract, And I think for JSON-like such things can be considered into the language standard library, because the future of commercial software API trend is more and more obvious, said the ugly point, a imposes with the times, anyway, I do not worry about the Golang library, the current Grade I am very good, far better than Ruby For the first five years of/python, see the list of existing high-quality libraries 3, Erlang is not gregarious, this is mainly reflected in the interaction with other languages, of course, there is a deep reason, Erlang itself has its own philosophy, such as the error recovery mechanism, you into a other language in the things into, this account is not counted , it's like you're going to have to sit with a cup of coffee with a garlic eater, anyway you write a Erlang port far more complex than go, and even more complicated than Python/java, which makes Erlang less effective at the bottom of the programming, I can't take advantage of a lot of the good stuff that Linux has, and I've always thought that Erlang's mysql/pg/oracle drive doesn't have to be, Erlang must be a self-container application, you just use something else, according to the Cask theory, You do not dare to claim 9 9, with a systematic view of the problem, I think a system of robustness can not rely on a component, which is why Ericsson itself is not widely used in Erlang 4, say the data type bar, I heard more than 1 people say that Erlang does not handle the string is good, It is the string as a list to deal with, in fact, it is so, but, or that sentence, contrary to human-oriented philosophy, should do some DSL, such as golang inside: = is a icing, equivalent to var xx yyy = zzzz, greatly convenient programmer less knocking many characters, Go Lang inside on the character turn can say basically and python almost, sLice map function is very powerful, support lambda condition, although the basic type of Erlang is very few, but there are many constructs, so-called constructs equivalent to Golang inside the complex struct, also strange, I just feel the Erlang structure hurts the eye good? May be the reason for the various brackets, and I think it is unnecessary, obviously Erlang lacks the gene of DSL, of course, with the age of Erlang, I do not exaggerate that, since the use of Erlang, my eyesight has dropped by about 100 degrees, I don't really like Lisp. The notation is also a kind of grammar, maybe this is related to functional programming: the formal derivation is far greater than the logic deduction 5, in fact, I am not concerned about the performance problem, because with Moore's Law, Unit computing Unit cost-effective will be infinitely high, but Golang since the performance approximation C, I still mention it, of course, Erlang can also, although slower than Java, but with Python a grade bar 6, and then talk about the error mechanism, because Erlang's error message is too tangled, at first thought I would not look at the error message, later also used the SASL, or is not intuitive, Even sometimes to use tools to analyze the crash file to locate the problem, or with the philosophy of Erlang, in Erlang everything is parallel, so it is not care is the physical which line error, only with the actor binding, and then tell you the actor ID and error code, You yourself with experience to analyze it, the advantage of doing so can be very convenient to locate the problem in parallel, but everything is relative, in this point a bit wrong, according to my experience, most of the time I just want to give me a clear point of which line of error, okay? Even the order of the BackTrace with the complete English sentence to print it? As for the errors in parallel in a timely manner in the command-style multithreaded language is not common, although not without, but encountered errors I try to debug, but not all the logic to use parallel thinking to locate the problem, I even think, for a system is not entirely parallel is not completely serial, As we measure the world can not be pure materialism can not be completely idealistic, this point golang do a good compromise, do not need to parallel when you honestly write serial code, need to parallel time also have a more complex mechanism to deal with, reasonable 7, say recruit Bar, previously recruit several c out of people, To tell the truth level is very good, can be completed a week a small component, libevent with the cooked very, later I pressed home Erlang, the result of people forced away, so far I regret, their wishful thinking imposed on others is really inappropriate, but I recruit pure erlang out of people, It is more difficult to say than to recruit OBJC, noSome people, the elegance of the talk technology first is not reliable, and then look at the mailing list, Golang activity is significantly higher than Erlang, the basic approximation of Ruby, more importantly, I do not worry about Golang talent, because as long as the familiar python/c/ruby/or C + +, Basic can achieve a half-day introduction, then can be crackling edge search data side work, although there is enough depth, but the threshold is extremely flat, engineering staff can also reuse a lot of knowledge. Erlang in this point is actually related to the 1th mishap, most people learn a week is not mind, not everyone's abstract thinking and world view are the same good, so functional programming although not more than the imperative language start late, but always learn very few people, this is history, for most people, but also want to solve the problem, Create value, not math to deduce go to 8, and finally I suggest that if you are playing C + +, now start learning Golang, is the best time to grow up with a reliable language, this feeling is very good, you use Erlang toss 1 applications, with go I am afraid to complete 10 open source projects, of course, Also to combine their own tastes, Golang is sublime Text, Erlang is Emacs believe their own judgment, believe their own logic, win is to win, lose is to lose
Related Article

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.