Go language note--go is a virtual machine runtime, or who will do GC, will not let users themselves to new and delete for memory management bar, and reflection! Go runtime is embedded in every executable file

Source: Internet
Author: User
Tags linux text editor sublime text gocode

2.7 Go Runtime (runtime)

Although the go compiler produces local executable code, the code is still running on the Go runtime (this part of the code can be found in the runtime package) . This runtime is similar to the virtual machine used by the Java and. NET languages, which manages including memory allocation, garbage collection (section 10.8), stack processing, goroutine, channel, slice (slice), Map and reflection (reflection), and more .

Runtime is written primarily in C (go 1.5) and is the top-level package for each go package. You can find the $GOROOT/src/runtime relevant content in the catalogue.

The garbage collector Go has a simple but efficient tag-clear collector. Its main idea comes from IBM's reusable garbage collector, which is designed to create an efficient, low latency concurrency collector. Currently, the GCCGO is not yet available, and a new collector for GC and GCCGO is under development. Using a programming language with garbage collection does not mean you can avoid problems with memory allocations, and allocating and reclaiming content is an activity that consumes CPU resources.

Go executables are much larger than the corresponding source code files, which means that the go runtime is embedded into every executable file . Of course, when deploying to a large number of clusters, the larger file size is also a headache problem. But in the overall case, Go is much easier to deploy than Java and Python. Because Go does not need to rely on any other files, it requires only a single static file, so you will not be confused with different versions of dependent files like other languages.

Excerpt from: https://github.com/Unknwon/the-way-to-go_ZH_CN/blob/master/eBook/02.7.md

If you follow eclipse or IntelliJ idea, look at the

Editor and integrated development environment

These editors contain code highlighting and other Go-related usage tools: Emacs, Vim, Xcode 6, KD Kate, TextWrangler, BBEdit, McEdit, TextMate, TextPad, JEdit, SciTE, Nano, notepad++, Geany, SlickEdit, IntelliJ idea and Sublime Text 2.

You can transform the Linux text editor GEdit into a good Go development tool, see page: http://gohelp.wordpress.com/.

Sublime text is a revolutionary cross-platform (Linux, Mac OS X, Windows) text editor that supports writing very many programming language code. For Go, it has a plug-in called Gosublime to support code completion and code templates.

There are also some more advanced Go development tools, some of which are used in the form of plugins as tools to develop Java.

IntelliJ idea Plugin is a plug-in for IntelliJ, with a good operating experience and code completion capabilities.

Liteide This is an integrated development environment specifically for go development, with excellent support for editing, compiling, and running go programs and projects. It also includes an abstract syntax tree view of the source code and some built-in tools (this development environment was developed by the Chinese VFC Uncle).

Goclipse is a plug-in for the Eclipse IDE with a lot of features and code completion through Gocode.

If you're not familiar with the integrated development environment, use liteide, and goclipse or IntelliJ idea Plugin is a good choice.

Code completion is generally implemented through the built-in gocode (e.g. Lieteide, goclipse), if you need to manually install Gocode, enter the command line commands go get -u github.com/nsf/gocode (be sure to configure the GO environment variable beforehand).

This is followed by a more detailed description of the three integrated development environments.

Go language note--go is a virtual machine runtime, or who will do GC, will not let users themselves to new and delete for memory management bar, and reflection! Go runtime is embedded in every executable file

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.