golang.org/toolchain@v0.0.1-go1.9rc2.windows-amd64/blog/content/toward-go2.article (about)

     1  Toward Go 2
     2  13 Jul 2017
     3  Tags: community
     4  
     5  Russ Cox
     6  
     7  * Introduction
     8  
     9  [This is the text of my talk today
    10  at Gophercon 2017, asking for the entire Go community's
    11  help as we discuss and plan Go 2.
    12  We will add a link to the video when it becomes available.]
    13  
    14  On September 25, 2007, after Rob Pike, Robert Griesemer, and Ken
    15  Thompson had been discussing a new programming language for a few
    16  days, Rob suggested the name “Go.”
    17  
    18  .html toward-go2/div-indent.html
    19  .image toward-go2/mail.png _ 446
    20  .html toward-go2/div-end.html
    21  
    22  The next year, Ian Lance Taylor and I joined the team, and together
    23  the five of us built two compilers and a standard library, leading up
    24  to the [[https://opensource.googleblog.com/2009/11/hey-ho-lets-go.html][open-source release]] on November 10, 2009.
    25  
    26  .html toward-go2/div-indent.html
    27  .image toward-go2/tweet.png _ 467
    28  .html toward-go2/div-end.html
    29  
    30  For the next two years, with the help of the new Go open source
    31  community, we experimented with changes large and small, refining Go
    32  and leading to the [[https://blog.golang.org/preview-of-go-version-1][plan for Go 1]], proposed on October 5, 2011.
    33  
    34  .html toward-go2/div-indent.html
    35  .image toward-go2/go1-preview.png _ 560
    36  .html toward-go2/div-end.html
    37  
    38  With more help from the Go community, we revised and implemented that
    39  plan, eventually [[https://blog.golang.org/go-version-1-is-released][releasing Go 1]] on March 28, 2012.
    40  
    41  .html toward-go2/div-indent.html
    42  .image toward-go2/go1-release.png _ 556
    43  .html toward-go2/div-end.html
    44  
    45  The release of Go 1 marked the culmination of nearly five years of
    46  creative, frenetic effort that took us from a name and a list of ideas
    47  to a stable, production language. It also marked an explicit shift
    48  from change and churn to stability.
    49  
    50  In the years leading to Go 1, we changed Go and broke everyone's Go
    51  programs nearly every week. We understood that this was keeping Go
    52  from use in production settings, where programs could not be rewritten
    53  weekly to keep up with language changes.
    54  As the [[https://blog.golang.org/go-version-1-is-released][blog post announcing Go 1]] says, the driving motivation was to provide a stable foundation
    55  for creating reliable products, projects, and publications (blogs,
    56  tutorials, conference talks, and books), to make users confident that
    57  their programs would continue to compile and run without change for
    58  years to come.
    59  
    60  After Go 1 was released, we knew that we needed to spend time using Go
    61  in the production environments it was designed for. We shifted
    62  explicitly away from making language changes toward using Go in our
    63  own projects and improving the implementation: we ported Go to many
    64  new systems, we rewrote nearly every performance-critical piece to
    65  make Go run more efficiently, and we added key tools like the
    66  [[https://blog.golang.org/race-detector][race detector]].
    67  
    68  Now we have five years of experience using Go to build large,
    69  production-quality systems. We have developed a sense of what works
    70  and what does not. Now it is time to begin the next step in Go's
    71  evolution and growth, to plan the future of Go. I'm here today to ask
    72  all of you in the Go community, whether you're in the audience at
    73  GopherCon or watching on video or reading the Go blog later today, to
    74  work with us as we plan and implement Go 2.
    75  
    76  In the rest of this talk, I'm going to explain our goals for Go 2; our
    77  constraints and limitations; the overall process; the importance of
    78  writing about our experiences using Go, especially as they relate to
    79  problems we might try to solve; the possible kinds of solutions; how
    80  we will deliver Go 2; and how all of you can help.
    81  
    82  * Goals
    83  
    84  The goals we have for Go today are the same as in 2007. We want to
    85  make programmers more effective at managing two kinds of scale:
    86  production scale, especially concurrent systems interacting with many
    87  other servers, exemplified today by cloud software; and development
    88  scale, especially large codebases worked on by many engineers
    89  coordinating only loosely, exemplified today by modern open-source
    90  development.
    91  
    92  These kinds of scale show up at companies of all sizes. Even a
    93  five-person startup may use large cloud-based API services provided by
    94  other companies and use more open-source software than software they
    95  write themselves. Production scale and development scale are just as
    96  relevant at that startup as they are at Google.
    97  
    98  Our goal for Go 2 is to fix the most significant ways Go fails to
    99  scale.
   100  
   101  (For more about these goals, see
   102  Rob Pike's 2012 article “[[https://talks.golang.org/2012/splash.article][Go at Google: Language Design in the Service of Software Engineering]]”
   103  and my GopherCon 2015 talk “[[https://blog.golang.org/open-source][Go, Open Source, Community]].”)
   104  
   105  * Constraints
   106  
   107  The goals for Go have not changed since the beginning, but the
   108  constraints on Go certainly have. The most important constraint is
   109  existing Go usage. We estimate that there are at least
   110  [[https://research.swtch.com/gophercount][half a million Go developers worldwide]],
   111  which means there are millions of Go source files and at
   112  least a billion of lines of Go code. Those programmers and that source
   113  code represent Go's success, but they are also the main constraint on
   114  Go 2.
   115  
   116  Go 2 must bring along all those developers. We must ask them to
   117  unlearn old habits and learn new ones only when the reward is great.
   118  For example, before Go 1, the method implemented by error types was
   119  named `String`. In Go 1, we renamed it `Error`, to distinguish error types
   120  from other types that can format themselves. The other day I was
   121  implementing an error type, and without thinking I named its method
   122  `String` instead of `Error`, which of course did not compile. After five
   123  years I still have not completely unlearned the old way. That kind of
   124  clarifying renaming was an important change to make in Go 1 but would
   125  be too disruptive for Go 2 without a very good reason.
   126  
   127  Go 2 must also bring along all the existing Go 1 source code. We must
   128  not split the Go ecosystem. Mixed programs, in which packages written
   129  in Go 2 import packages written in Go 1 and vice versa, must work
   130  effortlessly during a transition period of multiple years. We'll have
   131  to figure out exactly how to do that; automated tooling like go fix
   132  will certainly play a part.
   133  
   134  To minimize disruption, each change will require careful thought,
   135  planning, and tooling, which in turn limits the number of changes we
   136  can make. Maybe we can do two or three, certainly not more than five.
   137  
   138  I'm not counting minor housekeeping changes like maybe allowing identifiers
   139  in more spoken languages or adding binary integer literals. Minor
   140  changes like these are also important, but they are easier to get
   141  right. I'm focusing today on possible major changes, such as
   142  additional support for error handling, or introducing immutable or
   143  read-only values, or adding some form of generics, or other important
   144  topics not yet suggested. We can do only a few of those major changes.
   145  We will have to choose carefully.
   146  
   147  * Process
   148  
   149  That raises an important question. What is the process for developing
   150  Go?
   151  
   152  In the early days of Go, when there were just five of us, we worked in
   153  a pair of adjacent shared offices separated by a glass wall. It was
   154  easy to pull everyone into one office to discuss some problem and then
   155  go back to our desks to implement a solution. When some wrinkle arose
   156  during the implementation, it was easy to gather everyone again. Rob
   157  and Robert's office had a small couch and a whiteboard, so typically
   158  one of us went in and started writing an example on the board. Usually
   159  by the time the example was up, everyone else had reached a good
   160  stopping point in their own work and was ready to sit down and discuss
   161  it. That informality obviously doesn't scale to the global Go
   162  community of today.
   163  
   164  Part of the work since the open-source release of Go has been porting
   165  our informal process into the more formal world of mailing lists and
   166  issue trackers and half a million users, but I don't think we've ever
   167  explicitly described our overall process. It's possible we never
   168  consciously thought about it. Looking back, though, I think this is
   169  the basic outline of our work on Go, the process we've been following
   170  since the first prototype was running.
   171  
   172  .html toward-go2/div-indent.html
   173  .image toward-go2/process.png _ 410
   174  .html toward-go2/div-end.html
   175  
   176  Step 1 is to use Go, to accumulate experience with it.
   177  
   178  Step 2 is to identify a problem with Go that might need solving and to
   179  articulate it, to explain it to others, to write it down.
   180  
   181  Step 3 is to propose a solution to that problem, discuss it with
   182  others, and revise the solution based on that discussion.
   183  
   184  Step 4 is to implement the solution, evaluate it, and refine it based
   185  on that evaluation.
   186  
   187  Finally, step 5 is to ship the solution, adding it to the language, or
   188  the library, or the set of tools that people use from day to day.
   189  
   190  The same person does not have to do all these steps for a particular
   191  change. In fact, usually many people collaborate on any given step,
   192  and many solutions may be proposed for a single problem. Also, at any
   193  point we may realize we don’t want to go further with a particular
   194  idea and circle back to an earlier step.
   195  
   196  Although I don't believe we've ever talked about this process as a
   197  whole, we have explained parts of it. In 2012, when we released Go 1
   198  and said that it was time now to use Go and stop changing it, we were
   199  explaining step 1. In 2015, when we introduced the Go change proposal
   200  process, we were explaining steps 3, 4, and 5. But we've never
   201  explained step 2 in detail, so I'd like to do that now.
   202  
   203  (For more about the development of Go 1 and the shift away from
   204  language changes, see Rob Pike and Andrew Gerrand's
   205  OSCON 2012 talk “[[https://blog.golang.org/the-path-to-go-1][The Path to Go 1]].”
   206  For more about the proposal process, see
   207  Andrew Gerrand's GopherCon 2015 talk “[[https://www.youtube.com/watch?v=0ht89TxZZnk][How Go was Made]]” and the
   208  [[https://golang.org/s/proposal][proposal process documentation]].)
   209  
   210  * Explaining Problems
   211  
   212  .html toward-go2/div-indent.html
   213  .image toward-go2/process2.png _ 410
   214  .html toward-go2/div-end.html
   215  
   216  There are two parts to explaining a problem. The first part—the easier
   217  part—is stating exactly what the problem is. We developers are
   218  decently good at this. After all, every test we write is a statement
   219  of a problem to be solved, in language so precise that even a computer
   220  can understand it. The second part—the harder part—is describing the
   221  significance of the problem well enough that everyone can understand
   222  why we should spend time solving it and maintaining a solution. In
   223  contrast to stating a problem precisely, we don't need to describe a
   224  problem's significance very often, and we're not nearly as good at it.
   225  Computers never ask us “why is this test case important? Are you sure
   226  this is the problem you need to solve? Is solving this problem the
   227  most important thing you can be doing?” Maybe they will someday, but
   228  not today.
   229  
   230  Let's look at an old example from 2011. Here is what I wrote about
   231  renaming os.Error to error.Value while we were planning Go 1.
   232  
   233  .html toward-go2/div-indent.html
   234  .image toward-go2/error.png _ 495
   235  .html toward-go2/div-end.html
   236  
   237  It begins with a precise, one-line statement of the problem: in very
   238  low-level libraries everything imports "os" for os.Error. Then there
   239  are five lines, which I've underlined here, devoted to describing the
   240  significance of the problem: the packages that "os" uses cannot
   241  themselves present errors in their APIs, and other packages depend on
   242  "os" for reasons having nothing to do with operating system services.
   243  
   244  Do these five lines convince _you_ that this problem is significant?
   245  It depends on how well you can fill in the context I've left out:
   246  being understood requires anticipating what others need to know. For
   247  my audience at the time—the ten other people on the Go team at Google
   248  who were reading that document—those fifty words were enough. To
   249  present the same problem to the audience at GothamGo last fall—an
   250  audience with much more varied backgrounds and areas of expertise—I
   251  needed to provide more context, and I used about two hundred words,
   252  along with real code examples and a diagram. It is a fact of today's
   253  worldwide Go community that describing the significance of any problem
   254  requires adding context, especially illustrated by concrete examples,
   255  that you would leave out when talking to coworkers.
   256  
   257  Convincing others that a problem is significant is an essential step.
   258  When a problem appears insignificant, almost every solution will seem
   259  too expensive. But for a significant problem, there are usually many
   260  solutions of reasonable cost. When we disagree about whether to adopt
   261  a particular solution, we're often actually disagreeing about the
   262  significance of the problem being solved. This is so important that I
   263  want to look at two recent examples that show this clearly, at least
   264  in hindsight.
   265  
   266  ** Example: Leap seconds
   267  
   268  My first example is about time.
   269  
   270  Suppose you want to time how long an event takes. You write down the
   271  start time, run the event, write down the end time, and then subtract
   272  the start time from the end time. If the event took ten milliseconds,
   273  the subtraction gives a result of ten milliseconds, perhaps plus or
   274  minus a small measurement error.
   275  
   276  	start := time.Now()       // 3:04:05.000
   277  	event()
   278  	end := time.Now()         // 3:04:05.010
   279  	
   280  	elapsed := end.Sub(start) // 10 ms
   281  
   282  This obvious procedure can fail during a [[https://en.wikipedia.org/wiki/Leap_second][leap second]]. When our clocks
   283  are not quite in sync with the daily rotation of the Earth, a leap
   284  second—officially 11:59pm and 60 seconds—is inserted just before
   285  midnight. Unlike leap years, leap seconds follow no predictable
   286  pattern, which makes them hard to fit into programs and APIs. Instead
   287  of trying to represent the occasional 61-second minute, operating
   288  systems typically implement a leap second by turning the clock back
   289  one second just before what would have been midnight, so that 11:59pm
   290  and 59 seconds happens twice. This clock reset makes time appear to
   291  move backward, so that our ten-millisecond event might be timed as
   292  taking negative 990 milliseconds.
   293  
   294  	start := time.Now()       // 11:59:59.995
   295  	event()
   296  	end := time.Now()         // 11:59:59.005 (really 11:59:60.005)
   297  	
   298  	elapsed := end.Sub(start) // –990 ms
   299  
   300  Because the time-of-day clock is inaccurate for timing events across
   301  clock resets like this, operating systems now provide a second clock,
   302  the monotonic clock, which has no absolute meaning but counts seconds
   303  and is never reset.
   304  
   305  Except during the odd clock reset, the monotonic clock is no better
   306  than the time-of-day clock, and the time-of-day clock has the added
   307  benefit of being useful for telling time, so for simplicity Go 1’s
   308  time APIs expose only the time-of-day clock.
   309  
   310  In October 2015, a [[https://golang.org/issue/12914][bug report]] noted that Go programs could not time
   311  events correctly across clock resets, especially a typical leap second.
   312  The suggested fix was also the original issue title: “add a new API to access a
   313  monotonic clock source.” I argued that this problem was not
   314  significant enough to justify new API. A few months earlier, for the
   315  mid-2015 leap second, Akamai, Amazon, and Google had slowed their
   316  clocks a tiny amount for the entire day, absorbing the extra second
   317  without turning their clocks backward. It seemed like eventual
   318  widespread adoption of this “[[https://developers.google.com/time/smear][leap smear]]” approach would eliminate
   319  leap-second clock resets as a problem on production systems. In
   320  contrast, adding new API to Go would add new problems: we would have
   321  to explain the two kinds of clocks, educate users about when to use
   322  each, and convert many lines of existing code, all for an issue that
   323  rarely occurred and might plausibly go away on its own.
   324  
   325  We did what we always do when there's a problem without a clear
   326  solution: we waited. Waiting gives us more time to add experience and
   327  understanding of the problem and also more time to find a good
   328  solution. In this case, waiting added to our understanding of the
   329  significance of the problem, in the form of a thankfully
   330  [[https://www.theregister.co.uk/2017/01/04/cloudflare_trips_over_leap_second/][minor outage at Cloudflare]].
   331  Their Go code timed DNS requests during the end-of-2016
   332  leap second as taking around negative 990 milliseconds, which caused
   333  simultaneous panics across their servers, breaking 0.2% of DNS queries
   334  at peak.
   335  
   336  Cloudflare is exactly the kind of cloud system Go was intended for,
   337  and they had a production outage based on Go not being able to time
   338  events correctly. Then, and this is the key point, Cloudflare reported
   339  their experience in a blog post by John Graham-Cumming titled
   340  “[[https://blog.cloudflare.com/how-and-why-the-leap-second-affected-cloudflare-dns/][How and why the leap second affected Cloudflare DNS]].” By sharing concrete
   341  details of their experience with Go in production, John and Cloudflare helped us
   342  understand that the problem of accurate timing across leap second
   343  clock resets was too significant to leave unfixed. Two months after
   344  that article was published, we had designed and implemented a solution
   345  that will [[https://beta.golang.org/doc/go1.9#monotonic-time][ship in Go 1.9]]
   346  (and in fact we did it with [[https://golang.org/design/12914-monotonic][no new API]]).
   347  
   348  ** Example: Alias declarations
   349  
   350  My second example is support for alias declarations in Go.
   351  
   352  Over the past few years, Google has established a team focused on
   353  large-scale code changes, meaning API migration and bug fixes applied
   354  across our
   355  [[http://cacm.acm.org/magazines/2016/7/204032-why-google-stores-billions-of-lines-of-code-in-a-single-repository/pdf][codebase of millions of source files and billions of lines of code]]
   356  written in C++, Go, Java, Python, and other languages. One
   357  thing I've learned from that team's work is the importance, when
   358  changing an API from using one name to another, of being able to
   359  update client code in multiple steps, not all at once. To do this, it
   360  must be possible to write a declaration forwarding uses of the old
   361  name to the new name. C++ has #define, typedef, and using declarations
   362  to enable this forwarding, but Go has nothing. Of course, one of Go's
   363  goals is to scale well to large codebases, and as the amount of Go
   364  code at Google grew, it became clear both that we needed some kind of
   365  forwarding mechanism and also that other projects and companies would
   366  run into this problem as their Go codebases grew.
   367  
   368  In March 2016, I started talking with Robert Griesemer and Rob Pike
   369  about how Go might handle gradual codebase updates, and we arrived at
   370  alias declarations, which are exactly the needed forwarding mechanism.
   371  At this point, I felt very good about the way Go was evolving. We'd
   372  talked about aliases since the early days of Go—in fact, the first
   373  spec draft has [[https://go.googlesource.com/go/+/18c5b488a3b2e218c0e0cf2a7d4820d9da93a554/doc/go_spec#1182][an example using alias declarations]]—but each time we'd
   374  discussed aliases, and later type aliases, we had no clear use case
   375  for them, so we left them out. Now we were proposing to add aliases
   376  not because they were an elegant concept but because they solved a
   377  significant practical problem with Go meeting its goal of scalable
   378  software development. I hoped this would serve as a model for future
   379  changes to Go.
   380  
   381  Later in the spring, Robert and Rob wrote [[https://golang.org/design/16339-alias-decls][a proposal]],
   382  and Robert presented it in a [[https://www.youtube.com/watch?v=t-w6MyI2qlU][Gophercon 2016 lightning talk]]. The next few months
   383  did not go smoothly, and they were definitely not a model for future
   384  changes to Go. One of the many lessons we learned was the importance
   385  of describing the significance of a problem.
   386  
   387  A minute ago, I explained the problem to you, giving some background
   388  about how it can arise and why, but with no concrete examples that
   389  might help you evaluate whether the problem might affect you at some
   390  point. Last summer’s proposal and the lightning talk gave an abstract
   391  example, involving packages C, L, L1, and C1 through Cn, but no
   392  concrete examples that developers could relate to. As a result, most
   393  of the feedback from the community was based on the idea that aliases
   394  only solved a problem for Google, not for everyone else.
   395  
   396  Just as we at Google did not at first understand the significance of
   397  handling leap second time resets correctly, we did not effectively
   398  convey to the broader Go community the significance of handling
   399  gradual code migration and repair during large-scale changes.
   400  
   401  In the fall we started over. I gave a [[https://www.youtube.com/watch?v=h6Cw9iCDVcU][talk]] and wrote 
   402  [[https://talks.golang.org/2016/refactor.article][an article presenting the problem]]
   403  using multiple concrete examples drawn from
   404  open source codebases, showing how this problem arises everywhere, not
   405  just inside Google. Now that more people understood the problem and
   406  could see its significance, we had a [[https://golang.org/issue/18130][productive discussion]] about what
   407  kind of solution would be best. The outcome is that [[https://golang.org/design/18130-type-alias][type aliases]] will
   408  be [[https://beta.golang.org/doc/go1.9#language][included in Go 1.9]] and will help Go scale to ever-larger codebases.
   409  
   410  ** Experience reports
   411  
   412  The lesson here is that it is difficult but essential to describe the
   413  significance of a problem in a way that someone working in a different
   414  environment can understand. To discuss major changes to Go as a
   415  community, we will need to pay particular attention to describing the
   416  significance of any problem we want to solve. The clearest way to do
   417  that is by showing how the problem affects real programs and real
   418  production systems, like in 
   419  [[https://blog.cloudflare.com/how-and-why-the-leap-second-affected-cloudflare-dns/][Cloudflare's blog post]] and in
   420  [[https://talks.golang.org/2016/refactor.article][my refactoring article]].
   421  
   422  Experience reports like these turn an abstract problem into a concrete
   423  one and help us understand its significance. They also serve as test
   424  cases: any proposed solution can be evaluated by examining its effect
   425  on the actual, real-world problems the reports describe.
   426  
   427  For example, I've been examining generics recently, but I don't have
   428  in my mind a clear picture of the detailed, concrete problems that Go
   429  users need generics to solve. As a result, I can't answer a design
   430  question like whether to support generic methods, which is to say
   431  methods that are parameterized separately from the receiver. If we had
   432  a large set of real-world use cases, we could begin to answer a
   433  question like this by examining the significant ones.
   434  
   435  As another example, I’ve seen proposals to extend the error interface
   436  in various ways, but I haven't seen any experience reports showing how
   437  large Go programs attempt to understand and handle errors at all, much
   438  less showing how the current error interface hinders those attempts.
   439  These reports would help us all better understand the details and
   440  significance of the problem, which we must do before solving it.
   441  
   442  I could go on. Every major potential change to Go should be motivated
   443  by one or more experience reports documenting how people use Go today
   444  and why that's not working well enough. For the obvious major changes
   445  we might consider for Go, I'm not aware of many such reports,
   446  especially not reports illustrated with real-world examples.
   447  
   448  These reports are the raw material for the Go 2 proposal process, and
   449  we need all of you to write them, to help us understand your
   450  experiences with Go. There are half a million of you, working in a
   451  broad range of environments, and not that many of us.
   452  Write a post on your own blog,
   453  or write a [[https://www.medium.com/][Medium]] post,
   454  or write a [[https://gist.github.com/][Github Gist]] (add a `.md` file extension for Markdown),
   455  or write a [[https://docs.google.com/][Google doc]],
   456  or use any other publishing mechanism you like.
   457  After you've posted, please add the post to our new wiki page,
   458  [[https://golang.org/wiki/ExperienceReports][golang.org/wiki/ExperienceReports]].
   459  
   460  * Solutions
   461  
   462  .html toward-go2/div-indent.html
   463  .image toward-go2/process34.png _ 410
   464  .html toward-go2/div-end.html
   465  
   466  Now that we know how we're going to identify and explain problems that
   467  need to be solved, I want to note briefly that not all problems are
   468  best solved by language changes, and that's fine.
   469  
   470  One problem we might want to solve is that computers can often compute
   471  additional results during basic arithmetic operations, but Go does not
   472  provide direct access to those results. In 2013, Robert proposed that
   473  we might extend the idea of two-result (“comma-ok”) expressions to
   474  basic arithmetic. For example, if x and y are, say, uint32 values,
   475  `lo,`hi`=`x`*`y`
   476  would return not only the usual low 32 bits but also the high 32 bits
   477  of the product. This problem didn't seem particularly significant, so
   478  we [[https://golang.org/issue/6815][recorded the potential solution]] but didn't implement it. We waited.
   479  
   480  More recently, we designed for Go 1.9 a [[https://beta.golang.org/doc/go1.9#math-bits][math/bits package]] that
   481  contains various bit manipulation functions:
   482  
   483  	package bits // import "math/bits"
   484  	
   485  	func LeadingZeros32(x uint32) int
   486  	func Len32(x uint32) int
   487  	func OnesCount32(x uint32) int
   488  	func Reverse32(x uint32) uint32
   489  	func ReverseBytes32(x uint32) uint32
   490  	func RotateLeft32(x uint32, k int) uint32
   491  	func TrailingZeros32(x uint32) int
   492  	...
   493  
   494  The package has good Go
   495  implementations of each function, but the compilers also substitute
   496  special hardware instructions when available. Based on this experience
   497  with math/bits, both Robert and I now believe that making the
   498  additional arithmetic results available by changing the language is
   499  unwise, and that instead we should define appropriate functions in a
   500  package like math/bits. Here the best solution is a library change,
   501  not a language change.
   502  
   503  A different problem we might have wanted to solve, after Go 1.0, was
   504  the fact that goroutines and shared memory make it too easy to
   505  introduce races into Go programs, causing crashes and other
   506  misbehavior in production. The language-based solution would have been
   507  to find some way to disallow data races, to make it impossible to
   508  write or at least to compile a program with a data race. How to fit
   509  that into a language like Go is still an open question in the
   510  programming language world. Instead we added a tool to the main
   511  distribution and made it trivial to use: that tool, the [[https://blog.golang.org/race-detector][race detector]], has become
   512  an indispensible part of the Go experience. Here the best solution was
   513  a runtime and tooling change, not a language change.
   514  
   515  There will be language changes as well, of course, but not all
   516  problems are best solved in the language.
   517  
   518  * Shipping Go 2
   519  
   520  .html toward-go2/div-indent.html
   521  .image toward-go2/process5.png _ 410
   522  .html toward-go2/div-end.html
   523  
   524  Finally, how will we ship and deliver Go 2?
   525  
   526  I think the best plan would be to ship the [[https://golang.org/doc/go1compat][backwards-compatible parts]]
   527  of Go 2 incrementally, feature by feature, as part of the Go 1 release
   528  sequence. This has a few important properties. First, it keeps the Go
   529  1 releases on the [[https://golang.org/wiki/Go-Release-Cycle][usual schedule]], to continue the timely bug fixes and
   530  improvements that users now depend on. Second, it avoids splitting
   531  development effort between Go 1 and Go 2. Third, it avoids divergence
   532  between Go 1 and Go 2, to ease everyone's eventual migration. Fourth,
   533  it allows us to focus on and deliver one change at a time, which
   534  should help maintain quality. Fifth, it will encourage us to design
   535  features to be backwards-compatible.
   536  
   537  We will need time to discuss and plan before any changes start landing in
   538  Go 1 releases, but it seems plausible to me that we might start seeing
   539  minor changes about a year from now, for Go 1.12 or so. That also
   540  gives us time to land package management support first.
   541  
   542  Once all the backwards-compatible work is done, say in Go 1.20, then
   543  we can make the backwards-incompatible changes in Go 2.0. If there
   544  turn out to be no backwards-incompatible changes, maybe we just
   545  declare that Go 1.20 _is_ Go 2.0. Either way, at that point we will
   546  transition from working on the Go 1.X release sequence to working on
   547  the Go 2.X sequence, perhaps with an extended support window for the
   548  final Go 1.X release.
   549  
   550  This is all a bit speculative, and the specific release numbers
   551  I just mentioned are placeholders for ballpark estimates,
   552  but I want to make clear that we're not
   553  abandoning Go 1, and that in fact we will bring Go 1 along to the
   554  greatest extent possible.
   555  
   556  * Help Wanted
   557  
   558  *We*need*your*help.*
   559  
   560  The conversation for Go 2 starts today, and it's one that will happen
   561  in the open, in public forums like the mailing list and the issue
   562  tracker. Please help us at every step along the way.
   563  
   564  Today, what we need most is experience reports. Please tell us how Go
   565  is working for you, and more importantly not working for you. Write a
   566  blog post, include real examples, concrete detail, and real
   567  experience. And link it on our [[https://golang.org/wiki/ExperienceReports][wiki page]].
   568  That's how we'll start talking about what we, the Go community,
   569  might want to change about Go.
   570  
   571  Thank you.