Google Publishing Go programming language

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

Welcome to Icompiler-Multi-core software development network.

Google publishes the Go programming language, currently the experimental version. Fast compilation, type and security, concurrency, Happy coding, open source.

// a simple Helloworld program: hello.go
package main
import "fmt"
func main()
{
fmt.Printf("Hello, iCompiler/n")
}

Go was designed in September 2007 with the main designers of Robert Griesemer,rob Pike and Ken Thompson. Later Ian Lance Taylor implemented the GCC-based go compiler gccgo. The addition of Russ Rox drives the actual availability of languages and libraries. The design team is quite luxurious.

Robert Griesemer participates in the design of the JavaScript execution engine in chrome V8,V8 using the instant compilation technique and the Stop-the-world garbage collection mechanism of generational (generational). Rob Pike, who worked in Bell Labs, was the main designer of the UNIX operating system, the PLAN9 operating system, the Limbo programming language, and UTF-8 coding, and wrote the cynical article Systems software research was Irrelevant, there are two books, the Unix programming environment and the practice of programming. Ken Thompson is a Turing Award winner and is one of the founders of the UNIX operating system, the PLAN9 operating system, the UTF-8 encoding, and the B programming language (the predecessor of C). Google,ken and Robert have also designed Sawzall languages for large-scale data analysis. Ian Lance Taylor is a super-active figure in the GCC community, one of the leading designers of the gold connector and GCC process optimization lto, and is one of the founders of the Zembu company. Russ Rox's doctoral dissertation at MIT is about the design of the Xoc compiler.

Efficient compiling, efficient execution and simple coding are the developers ' expectations. Go is a system-oriented language designed to be based on the following scenarios. C-Language header files caused by dependency management can not be quickly compiled, C + + and Java cumbersome type system makes people more inclined to Python and JavaScript dynamic type, garbage collection and parallel basic concepts are not in the current system programming language to be well supported. So the go design simplifies the dependency management of header files, uses a lightweight type system, has no inheritance of types, supports garbage collection and concurrency, and thus provides a solution for designing system software on multicore systems. In the context of concurrency support, GO provides storage model documentation describing atomicity, using the sync package to support mutual exclusion, and to share storage based on communication rather than shared memory.

Why not extend existing languages (such as C and C + +) through the library? They think that there are too many problems with the design of C and C + +, such as lack of garbage collection, header file nesting and dependency chain too long, lack of concurrency support, etc. The current Intel-designed CT programming system for data parallelism is implemented by extending C + +, which is implemented by cilk++. Interested readers are welcome to explore! Now go is only an experimental version, and there are still some open questions, such as whether exceptions and paradigms are supported. The Go Language Design FAQ has many explanations for the tradeoff of language design.

For a programming language, developers focus on the compiler (compiler) and runtime (runtime). The go compiler supports both Linux and Mac OS X operating systems, as well as the x86-64, x86, and arm three architectures. Many of Google's designs now support arm, because an important backend of the Android system is arm. The go compiler has two implementations, one for GC and the other for GCCGO using the GCC backend. Because some designers of go come from the PLAN9 team, the compiler naming also uses the compiler naming tradition in Plan9, such as 6g is the compiler on the x86-64, 8g is the compiler on the 386, 5g is the compiler on arm. They have considered using the LLVM compiler to implement go, because of the big wait, unable to meet performance goals and give up. They especially emphasize that go is a good language to implement compilers! The go runtime includes the Mark-and-sweep garbage collector, array and string shard support, segment stack support, and go library implementations. At present, the runtime of Gccgo is based on glibc implementation, does not support segment stack management and garbage collection, because the stack size is fixed, so the number of go functions can be created at a time limited. The GC compiles faster than GCCGO, and the runtime system is more robust, but the resulting code quality is slightly inferior. Developers are currently recommended to use GC to play go.


Let ' s go! http://golang.org

6g hello.go 6l hello.6./6.out

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.