GO1.6 Language Learning Note 1-Basic article

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed. first, go language advantage  
    1. Can be directly compiled into machine code, go compilation generated is a static executable file, in addition to glibc outside the external dependencies
    2. Statically typed language, but with a sense of dynamic language
    3. Concurrency is supported at the language level. Goroutine and channel make it easy to write high-concurrency server-side software, and in many cases there is no need to consider locking mechanisms and the various problems that arise. A single go application can also effectively utilize multiple CPU cores, performing well in parallel execution
    4. Built-in runtime, supports garbage collection
    5. Cross-platform compilation
    6. Inline C Support
    7. Easy to learn, the Go keyword is 25, but the expressive power is strong and almost supports most of the features you've seen in other languages: inheritance, overloading, objects, etc.
    8. Retain but significantly simplify pointers
    9. Multi-parameter return
    10. Array,slice,map and other built-in basic data structures
    11. Interface any data structure, as long as the implementation of Interface defined functions, automatically implement this Interface
second, the go language can be qualified for what work?
    1. Server programming, such as processing logs, data packaging, virtual machine processing, file systems, etc.
    2. Distributed systems, database proxies, etc.
    3. Network programming, including Web applications, API applications, download applications
    4. In-memory database
    5. Cloud Platform
third, go language defects  
    1. Go import package does not support version, sometimes upgrade is easy to cause project not to run
    2. Go Goroutine once started, the switch between different goroutine is not controlled by the program, runtime scheduling, the need for rigorous logic
    3. Large GC Delay
Iv. Success Stories  
    1. Docker
five, in-depth understanding of the concurrency of Go syntax sugar  The concurrency syntax sugar for Go is mainly related to the three problems of large concurrency (massive concurrency), competitive conditions (race condition), error handling (err handling).
    1. In the big concurrency aspect, go solves very well, the essence is user-space thread.
    2. The basic idea of the go-to-chan channel is to ensure that each logical flow uses a separate memory space, restricting some constrained methods to communicate. But for efficiency reasons (which require a copy operation to deliver a message), there is no guarantee of coercion and it is still easy to access shared memory. The correctness of the program depends only on the correct use of the programmer and strict adherence to slogan.
    3. In Go, the co-process is not completely independent (no process isolation) for the lack of localization capability (no identity) for the created process. When a system exception occurs (for example, in addition to 0), the entire program is dropped and the state fallback and recovery operation is not possible.

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.