Go 1 与 Go 程序的未来



The release of Go version 1, Go 1 for short, is a major milestone in the development of the language. Go 1 is a stable platform for the growth of programs and projects written in Go.

Go 版本 1(简称 Go 1)的发布,在该语言的开发历程中是一个重要的里程碑。 对于用Go编写的程序与项目的成长来说,Go 1是一个稳定的平台。

Go 1 defines two things: first, the specification of the language; and second, the specification of a set of core APIs, the "standard packages" of the Go library. The Go 1 release includes their implementation in the form of two compiler suites (gc and gccgo), and the core libraries themselves.

Go 1定义了两件事:第一,是该语言的规范;第二,是核心API集的规范。 Go 1的发布包含了两组编译器套件(gc与gccgo)的实现,以及它们的核心库。

It is intended that programs written to the Go 1 specification will continue to compile and run correctly, unchanged, over the lifetime of that specification. At some indefinite point, a Go 2 specification may arise, but until that time, Go programs that work today should continue to work even as future "point" releases of Go 1 arise (Go 1.1, Go 1.2, etc.).

其目的在于,Go 1规范编写的程序将无需改变而继续正确地编译并运行, 直到该规范的生命周期结束。在将来的某个时刻,Go2规范将会出现, 但直到那一刻以前,现今能够工作的Go程序将继续工作,即便在未来Go 1的“点”发行版出现时(Go 1.1、Go 1.2等等。)。

Compatibility is at the source level. Binary compatibility for compiled packages is not guaranteed between releases. After a point release, Go source will need to be recompiled to link against the new release.

兼容性是在源码级上的。已编译包的二进制兼容性并不在发行版之间保证。 在一个点发行版出现后,Go源码将需要针对新发行版重新编译。

The APIs may grow, acquiring new packages and features, but not in a way that breaks existing Go 1 code.

API会通过发展来获得新的包与特性,但在某种程度上,它不会破坏现有的Go 1代码。



Although we expect that the vast majority of programs will maintain this compatibility over time, it is impossible to guarantee that no future change will break any program. This document is an attempt to set expectations for the compatibility of Go 1 software in the future. There are a number of ways in which a program that compiles and runs today may fail to do so after a future point release. They are all unlikely but worth recording.

尽管我们希望尽可能地保持绝大多数程序的兼容性, 但要保证将来的改变不会破坏任何程序是不可能的。本文档试图整理出将来 Go 1 软件预期的兼容性。在未来的点发行版发布后,现今程序某些方面的编译与运行可能会失败。 尽管它们不太可能发生,但仍值得记录。

Of course, for all of these possibilities, should they arise, we would endeavor whenever feasible to update the specification, compilers, or libraries without affecting existing code.

当然,对于这些所有应该会出现的可能性,我们会在任何可能的时候更新规范、 编译或库而尽量不影响现有的代码。

These same considerations apply to successive point releases. For instance, code that runs under Go 1.2 should be compatible with Go 1.2.1, Go 1.3, Go 1.4, etc., although not necessarily with Go 1.1 since it may use features added only in Go 1.2

有一些考虑适用于连续的点发行版。例如,在Go 1.2下运行的代码应当与Go 1.2.1、Go 1.3、Go 1.4等等相兼容,尽管没必要与Go 1.1相兼容, 但也会只在Go 1.2中添加一些特性来保证兼容性。

Features added between releases, available in the source repository but not part of the numbered binary releases, are under active development. No promise of compatibility is made for software using such features until they have been released.

在发行版之间添加的特性,将在源码仓库中可用,而非在活跃开发下已编号的二进制发行版的部分。 对于软件使用此类特性将不保证兼容性,直到它们发布后。

Finally, although it is not a correctness issue, it is possible that the performance of a program may be affected by changes in the implementation of the compilers or libraries upon which it depends. No guarantee can be made about the performance of a given program between releases.

最后,尽管它不是一个合理的问题,但它在编译器实现或库的依赖中的改变可能会影响到程序的性能。 关于在发行版之间给定程序的性能并不保证。

Although these expectations apply to Go 1 itself, we hope similar considerations would be made for the development of externally developed software based on Go 1.

尽管这些预期应用于Go 1本身,但我们希望相似的考虑对基于Go 1的外部开发软件也适用。



Code in sub-repositories of the main go tree, such as golang.org/x/net, may be developed under looser compatibility requirements. However, the sub-repositories will be tagged as appropriate to identify versions that are compatible with the Go 1 point releases.

主Go源码树子仓库中的代码,例如 code.google.com/p/go.net, 在更宽松的兼容性需求下开发。然而,子仓库将适当地标记为与Go 1的点发行相兼容的相同版本。

Operating systems


It is impossible to guarantee long-term compatibility with operating system interfaces, which are changed by outside parties. The syscall package is therefore outside the purview of the guarantees made here. As of Go version 1.4, the syscall package is frozen. Any evolution of the system call interface must be supported elsewhere, such as in the go.sys subrepository. For details and background, see this document.

Go语言无法保证与系统接口的长期兼容性,因为它们会被外部用户修改。 因此 syscall 包不在本文所做的担保之内。 截至 Go 1.4 版本,syscall 包将会被冻结。任何系统调用接口的发展必须在其它地方支持, 如 go.sys 子代码库。 更多详情与背景见此文档



Finally, the Go tool chain (compilers, linkers, build tools, and so on) are under active development and may change behavior. This means, for instance, that scripts that depend on the location and properties of the tools may be broken by a point release.

最后,Go工具链(编译器、链接器、构建工具等等)在活跃的开发下可能改变行为。 也就是说,例如依赖于工具的位置及其属性的脚本可能在点发行版中被破坏。

These caveats aside, we believe that Go 1 will be a firm foundation for the development of Go and its ecosystem.

在这些注意事项之外,我们相信Go 1将成为Go及其生态系统开发的坚实基础。