github.com/varialus/godfly@v0.0.0-20130904042352-1934f9f095ab/doc/go1compat.html (about)

     1  <!--{
     2  	"Title": "Go 1 and the Future of Go Programs"
     3  }-->
     4  
     5  <h2 id="introduction">Introduction</h2>
     6  <p>
     7  The release of Go version 1, Go 1 for short, is a major milestone
     8  in the development of the language. Go 1 is a stable platform for
     9  the growth of programs and projects written in Go.
    10  </p>
    11  
    12  <p>
    13  Go 1 defines two things: first, the specification of the language;
    14  and second, the specification of a set of core APIs, the "standard
    15  packages" of the Go library. The Go 1 release includes their
    16  implementation in the form of two compiler suites (gc and gccgo),
    17  and the core libraries themselves.
    18  </p>
    19  
    20  <p>
    21  It is intended that programs written to the Go 1 specification will
    22  continue to compile and run correctly, unchanged, over the lifetime
    23  of that specification. At some indefinite point, a Go 2 specification
    24  may arise, but until that time, Go programs that work today should
    25  continue to work even as future "point" releases of Go 1 arise (Go
    26  1.1, Go 1.2, etc.).
    27  </p>
    28  
    29  <p>
    30  Compatibility is at the source level. Binary compatibility for
    31  compiled packages is not guaranteed between releases. After a point
    32  release, Go source will need to be recompiled to link against the
    33  new release.
    34  </p>
    35  
    36  <p>
    37  The APIs may grow, acquiring new packages and features, but not in
    38  a way that breaks existing Go 1 code.
    39  </p>
    40  
    41  <h2 id="expectations">Expectations</h2>
    42  
    43  <p>
    44  Although we expect that the vast majority of programs will maintain
    45  this compatibility over time, it is impossible to guarantee that
    46  no future change will break any program. This document is an attempt
    47  to set expectations for the compatibility of Go 1 software in the
    48  future. There are a number of ways in which a program that compiles
    49  and runs today may fail to do so after a future point release. They
    50  are all unlikely but worth recording.
    51  </p>
    52  
    53  <ul>
    54  <li>
    55  Security. A security issue in the specification or implementation
    56  may come to light whose resolution requires breaking compatibility.
    57  We reserve the right to address such security issues.
    58  </li>
    59  
    60  <li>
    61  Unspecified behavior. The Go specification tries to be explicit
    62  about most properties of the language, but there are some aspects
    63  that are undefined. Programs that depend on such unspecified behavior
    64  may break in future releases.
    65  </li>
    66  
    67  <li>
    68  Specification errors. If it becomes necessary to address an
    69  inconsistency or incompleteness in the specification, resolving the
    70  issue could affect the meaning or legality of existing programs.
    71  We reserve the right to address such issues, including updating the
    72  implementations. Except for security issues, no incompatible changes
    73  to the specification would be made.
    74  </li>
    75  
    76  <li>
    77  Bugs. If a compiler or library has a bug that violates the
    78  specification, a program that depends on the buggy behavior may
    79  break if the bug is fixed. We reserve the right to fix such bugs.
    80  </li>
    81  
    82  <li>
    83  Struct literals. For the addition of features in later point
    84  releases, it may be necessary to add fields to exported structs in
    85  the API. Code that uses untagged struct literals (such as pkg.T{3,
    86  "x"}) to create values of these types would fail to compile after
    87  such a change. However, code that uses tagged literals (pkg.T{A:
    88  3, B: "x"}) will continue to compile after such a change. We will
    89  update such data structures in a way that allows tagged struct
    90  literals to remain compatible, although untagged literals may fail
    91  to compile. (There are also more intricate cases involving nested
    92  data structures or interfaces, but they have the same resolution.)
    93  We therefore recommend that composite literals whose type is defined
    94  in a separate package should use the tagged notation.
    95  </li>
    96  
    97  <li>
    98  Dot imports. If a program imports a standard package
    99  using <code>import . "path"</code>, additional names defined in the
   100  imported package in future releases may conflict with other names
   101  defined in the program.  We do not recommend the use of <code>import .</code>
   102  outside of tests, and using it may cause a program to fail
   103  to compile in future releases.
   104  </li>
   105  
   106  </ul>
   107  
   108  <p>
   109  Of course, for all of these possibilities, should they arise, we
   110  would endeavor whenever feasible to update the specification,
   111  compilers, or libraries without affecting existing code.
   112  </p>
   113  
   114  <p>
   115  These same considerations apply to successive point releases. For
   116  instance, code that runs under Go 1.2 should be compatible with Go
   117  1.2.1, Go 1.3, Go 1.4, etc., although not necessarily with Go 1.1
   118  since it may use features added only in Go 1.2
   119  </p>
   120  
   121  <p>
   122  Features added between releases, available in the source repository
   123  but not part of the numbered binary releases, are under active
   124  development. No promise of compatibility is made for software using
   125  such features until they have been released.
   126  </p>
   127  
   128  <p>
   129  Finally, although it is not a correctness issue, it is possible
   130  that the performance of a program may be affected by
   131  changes in the implementation of the compilers or libraries upon
   132  which it depends.
   133  No guarantee can be made about the performance of a
   134  given program between releases.
   135  </p>
   136  
   137  <p>
   138  Although these expectations apply to Go 1 itself, we hope similar
   139  considerations would be made for the development of externally
   140  developed software based on Go 1.
   141  </p>
   142  
   143  <h2 id="subrepos">Sub-repositories</h2>
   144  
   145  <p>
   146  Code in sub-repositories of the main go tree, such as
   147  <a href="http://code.google.com/p/go.net">code.google.com/p/go.net</a>,
   148  may be developed under
   149  looser compatibility requirements. However, the sub-repositories
   150  will be tagged as appropriate to identify versions that are compatible
   151  with the Go 1 point releases.
   152  </p>
   153  
   154  <h2 id="tools">Tools</h2>
   155  
   156  <p>
   157  Finally, the Go tool chain (compilers, linkers, build tools, and so
   158  on) are under active development and may change behavior. This
   159  means, for instance, that scripts that depend on the location and
   160  properties of the tools may be broken by a point release.
   161  </p>
   162  
   163  <p>
   164  These caveats aside, we believe that Go 1 will be a firm foundation
   165  for the development of Go and its ecosystem.
   166  </p>