Go 1.5发布了
3 分钟阅读
Go 1.5 is released - Go 1.5发布了
Andrew Gerrand 19 August 2015
Today the Go project is proud to release Go 1.5, the sixth major stable release of Go.
今天,Go项目很自豪地发布了Go 1.5,这是Go的第六个主要稳定版本。
This release includes significant changes to the implementation. The compiler tool chain was translated from C to Go, removing the last vestiges of C code from the Go code base. The garbage collector was completely redesigned, yielding a dramatic reduction in garbage collection pause times. Related improvements to the scheduler allowed us to change the default GOMAXPROCS value (the number of concurrently executing goroutines) from 1 to the number of logical CPUs. Changes to the linker enable distributing Go packages as shared libraries to link into Go programs, and building Go packages into archives or shared libraries that may be linked into or loaded by C programs (design doc).
这个版本包括对实现的重大改变。编译器工具链从C语言翻译成Go语言,从Go代码库中删除了最后的C语言代码残余。垃圾收集器被完全重新设计,极大地减少了垃圾收集的暂停时间。对调度器的相关改进使我们能够将默认的GOMAXPROCS值(同时执行的goroutine的数量)从1改为逻辑CPU的数量。对链接器的修改使我们能够将Go包作为共享库发布,以链接到Go程序中,并将Go包构建为可链接到C程序或由C程序加载的档案或共享库(设计文档)。
The release also includes improvements to the developer tools. Support for “internal” packages permits sharing implementation details between packages. Experimental support for “vendoring” external dependencies is a step toward a standard mechanism for managing dependencies in Go programs. The new “go tool trace” command enables the visualisation of program traces generated by new tracing infrastructure in the runtime. The new “go doc” command provides an improved command-line interface for viewing Go package documentation.
该版本还包括对开发者工具的改进。对 “内部 “包的支持允许包之间共享实现细节。实验性地支持 “出售 “外部依赖关系,这是朝着在Go程序中管理依赖项的标准机制迈出的一步。新的 “go tool trace “命令使运行时中新的跟踪基础设施产生的程序跟踪变得可视化。新的 “go doc “命令提供了一个改进的命令行界面,用于查看Go包的文档。
There are also several new operating system and architecture ports. The more mature new ports are darwin/arm, darwin/arm64 (Apple’s iPhone and iPad devices), and linux/arm64. There is also experimental support for ppc64 and ppc64le (IBM 64-bit PowerPC, big and little endian).
还有几个新的操作系统和架构端口。比较成熟的新端口是 darwin/arm、darwin/arm64(苹果的 iPhone 和 iPad 设备)和 linux/arm64。还有对ppc64和ppc64le(IBM 64位PowerPC,big and little endian)的实验性支持。
The new darwin/arm64 port and external linking features fuel the Go mobile project, an experiment to see how Go might be used for building apps on Android and iOS devices. (The Go mobile work itself is not part of this release.)
新的darwin/arm64端口和外部链接功能为Go移动项目提供了动力,这是一项实验,旨在了解Go如何用于在Android和iOS设备上构建应用程序。(Go移动项目本身并不是这个版本的一部分)。
The only language change is very minor, the lifting of a restriction in the map literal syntax to make them more succinct and consistent with slice literals.
唯一的语言变化是非常小的,即取消了地图字面语法的限制,使其更加简洁并与片状字面一致。
The standard library saw many additions and improvements, too. The flag package now shows cleaner usage messages. The math/big package now provides a Float type for computing with arbitrary-precision floating point numbers. An improvement to the DNS resolver on Linux and BSD systems has removed the cgo requirement for programs that do name lookups. The go/types package has been moved to the standard library from the golang.org/x/tools repository. (The new go/constant and go/importer packages are also a result of this move.) The reflect package has added the ArrayOf and FuncOf functions, analogous to the existing SliceOf function. And, of course, there is the usual list of smaller fixes and improvements.
标准库也有了许多补充和改进。标志包现在显示了更清晰的使用信息。math/big 包现在提供了一个 Float 类型,用于计算任意精度的浮点数字。对 Linux 和 BSD 系统上的 DNS 解析器的改进,取消了对进行名称查询的程序的 cgo 要求。go/types 包已经从 golang.org/x/tools 仓库移到了标准库中。(新的 go/constant 和 go/importer 包也是这次移动的结果)。reflect包增加了ArrayOf和FuncOf函数,类似于现有的SliceOf函数。当然,还有一些常规的小型修复和改进。
For the full story, see the detailed release notes. Or if you just can’t wait to get started, head over to the downloads page to get Go 1.5 now.
关于完整的故事,请看详细的发布说明。如果您迫不及待地想开始使用,请到下载页面获取Go 1.5。