系统 – Googles GOLANG是解释器还是编译器?

前端之家收集整理的这篇文章主要介绍了系统 – Googles GOLANG是解释器还是编译器?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我一直在研究高隆,我看到它有一个编译器.
但是它是将其编译成Assembly级代码还是将其转换为BYTECODES,然后调用该编译?我的意思是即使在PHP中,我们也可以将其转换为BYTECODES并具有更快的性能.
高隆是系统级编程和编译的替代品吗?
这实际上是一个编译器(实际上它编写了2个编译器),它使得完全自给自足的可执行文件.您不需要任何补充库或任何类型的运行时在您的服务器上执行它.你只需要为目标计算机架构编译它.

the documentation

There are two official Go compiler tool chains. This document focuses
on the gc Go compiler and tools (6g,8g etc.). For information on how
to work on gccgo,a more traditional compiler using the GCC back end,
see Setting up and using gccgo.

The Go compilers support three instruction sets. There are important
differences in the quality of the compilers for the different
architectures.

amd64 (a.k.a. x86-64); 6g,6l,6c,6a
A mature implementation. The
compiler has an effective optimizer (registerizer) and generates good
code (although gccgo can do noticeably better sometimes).

386 (a.k.a. x86 or x86-32); 8g,8l,8c,8a
Comparable to the amd64 port.

arm (a.k.a. ARM); 5g,5l,5c,5a
Supports only Linux binaries. Less widely used than
the other ports and therefore not as thoroughly tested.

Except for
things like low-level operating system interface code,the run-time
support is the same in all ports and includes a mark-and-sweep garbage
collector,efficient array and string slicing,and support for
efficient goroutines,such as stacks that grow and shrink on demand.

The compilers can target the FreeBSD,Linux,NetBSD,OpenBSD,OS X
(Darwin),and Windows operating systems. The full set of supported
combinations is listed in the discussion of environment variables
below.

在服务器上,通常会定位到amd64平台.

请注意,Go以编译速度而闻名.在部署我的服务器程序时,我不会为开发计算机上的不同平台构建:我部署源代码,并直接在生产服务器上进行编译.自从Go1以来,我从来没有在一个平台上编译代码,而不是在其他平台上进行编译.

在Windows上,我的开发计算机上没有任何问题,只需将此exe发送给从未安装任何Go的用户.

猜你在找的Go相关文章