diff --git a/doc/go1.5.html b/doc/go1.5.html index d2244da3941..62d6ffd1d55 100644 --- a/doc/go1.5.html +++ b/doc/go1.5.html @@ -28,7 +28,7 @@ once necessary for building the distribution is gone.
go
command now provides experimental
+The go
command now provides experimental
support for "vendoring" external dependencies.
go tool trace
command supports fine-grained
+tracing of program execution.
+go doc
command (distinct from godoc
)
+is customized for command-line use.
+@@ -59,7 +69,7 @@ The release also contains one small language change involving map literals.
-Finally, the timing of the release +Finally, the timing of the release strays from the usual six-month interval, both to provide more time to prepare this major release and to shift the schedule thereafter to time the release dates more conveniently. @@ -67,7 +77,7 @@ time the release dates more conveniently.
Due to an oversight, the rule that allowed the element type to be elided from slice literals was not @@ -107,7 +117,7 @@ There was a C compiler in the tree in 1.4 and earlier. It was used to build the runtime; a custom compiler was necessary in part to guarantee the C code would work with the stack management of goroutines. Since the runtime is in Go now, there is no need for this C compiler and it is gone. -Details of the process to eliminate C are discussed elsewhere. +Details of the process to eliminate C are discussed elsewhere.
@@ -122,7 +132,7 @@ An overview of this process is available in the slides for this presentation.
-
Independent of but encouraged by the move to Go, the names of the tools have changed.
@@ -147,7 +157,23 @@ rather than .8
, .6
, etc.
-TODO +The garbage collector has been re-engineered for 1.5 as part of the development +outlined in the design document. +Expected latencies are much lower than with the collector +in prior releases, through a combination of advanced algorithms, +better scheduling of the collector, +and running more of the collection in parallel with the user program. +The "stop the world" phase of the collector +will almost always be under 10 milliseconds and usually much less. +
+ ++For systems that benefit from low latency, such as user-responsive web sites, +the drop in expected latency with the new collector may be important. +
+ ++Details of the new collector were presented in TODO: GopherCon talk.
gccgo
) will serve.
-For details, see the design document.
+For details, see the design document.
-build: external linking support for windows (https://golang.org/cl/7163, 7282, 7283, 7284, 7534, 7535) -cmd/cover: tool now lives in the standard repository (https://golang.org/cl/9560) -cmd/gc: constant arithmetic is based on math/big (https://golang.org/cl/7830, 7851, 7857, 8426, 7858, 7912, 8171) -cmd/go, go/build: add ${SRCDIR} variable expansion to cgo lines (https://golang.org/cl/1756) -cmd/go: add $DOLLAR to generate's variables (https://golang.org/cl/8091) -cmd/go: std wildcard now excludes commands in main repo (https://golang.org/cl/5550) -cmd/go: .swig/.swigcxx files now require SWIG 3.0.6 or later -cmd/go: add -run flag to go generate (https://golang.org/cl/9005) -cmd/go: add $GOLINE to generate's variables (https://golang.org/cl/9007) -cmd/go: add go doc (https://golang.org/cl/9227) -cmd/go: internal enforced even outside standard library (golang.org/s/go14internal; https://golang.org/cl/9156) -cmd/go, testing: add go test -count (https://golang.org/cl/10669) -cmd/go: add preliminary support for vendor directories (https://golang.org/cl/10923) -cmd/vet: better validation of struct tags (https://golang.org/cl/2685) -cmd/ld: no longer record build timestamp in Windows PE file header (https://golang.org/cl/3740) -cmd/go: add -toolexec build option -cmd/go: drop -ccflags build option -cmd/go: add -asmflags build option -cmd/go: add -buildmode build option -cmd/gc: add -dynlink option (for amd64 only) -cmd/ld: add -buildmode option -cmd/trace: new command to view traces (https://golang.org/cl/3601) +Translating
++As part of the process to eliminate C from the tree, the compiler and +linker were translated from C to Go. +It was a genuine (machine assisted) translation, so the new programs are essentially +the old programs translated rather than new ones with new bugs. +We are confident the translation process has introduced few if any new bugs, +and in fact uncovered a number of previously unknown bugs, now fixed. +
+ ++The assembler is a new program, however; it is described below. +
+ +Renaming
+ ++The suites of programs that were the compilers (
+ +6g
,8g
, etc.), +the assemblers (6a
,8a
, etc.), +and the linkers (6l
,8l
, etc.) +have each been consolidated into a single tool that is configured +by the environment variablesGOOS
andGOARCH
. +The old names are gone; the new tools are available through thego
tool
+mechanism asgo tool compile
, +go tool asm
, +and go tool link
. +Also, the file suffixes.6
,.8
etc. for the +intermediate object files are also gone; now they are just plain.o
files. ++For example, to build and link a program on amd64 for Darwin +using the tools directly, rather than through
+ +go build
, +one would run: ++$ export GOOS=darwin GOARCH=amd64 +$ go tool compile program.go +$ go tool link program.o+Moving
+ ++Because the
+ +go/types
package +has now moved into the main repository (see below), +thevet
and +cover
+tools have also been moved. +They are no longer maintained in the externalgolang.org/x/tools
repository, +although (deprecated) source still resides there for compatibility with old releases. +Compiler
+ ++As described above, the compiler in Go 1.5 is a single Go program, +translated from the old C source, that replaces
+ +6g
,8g
, +and so on. +Its target is configured by the environment variablesGOOS
andGOARCH
. ++The 1.5 compiler is mostly equivalent to the old, +but some internal details have changed. +One significant change is that evaluation of constants now uses +the
+ +math/big
package +rather than a custom (and less well tested) implementation of high precision +arithmetic. +We do not expect this to affect the results. ++For the amd64 architecture only, the compiler has a new option,
+-dynlink
, +that assists dynamic linking by supporting references to Go symbols +defined in external shared libraries. +Assembler
-The assembler in Go 1.5 is a single new Go program that replaces -the suite of C-language assemblers (
6a
, -8a
, etc.) in previous releases. -The values of the environment variables +Like the compiler and linker, the assembler in Go 1.5 is a single program +that replaces the suite of assemblers (6a
, +8a
, etc.) and the environment variablesGOARCH
andGOOS
-choose which architecture and operating system the generated -code will be for. -This is practical because the assembly language syntax has always -been idiosyncratic and nearly uniform across architectures; -what differs is just the list of instructions available and the -syntax of some addressing modes. -With the variation easily configured at startup, a single -assembler binary can cover all architectures. -(See the updated assembler guide -for more information about the language and some of -the changes listed below.) +configure the architecture and operating system. +Unlike the other programs, the assembler is a wholly new program +written in Go.The new assembler is very nearly compatible with the previous -one, but there are a few changes that may affect some +ones, but there are a few changes that may affect some assembler source files. +See the updated assembler guide +for more specific information about these changes. In summary: +
@@ -276,10 +350,8 @@ different. It now uses unsigned 64-bit arithmetic and the precedence of operators (
+
,-
,<<
, etc.) comes from Go, not C. -Since there are few assembly programs to start with, and few use -complex arithmetic expressions, -and of those even fewer will be affected by these changes, we expect -almost no programs will need to be updated. +We expect these changes to affect very few programs but +manual verification may be required.@@ -321,33 +393,190 @@ supported (the assembler includes an implementation of a simplified C preprocessor), the feature was removed.
-Performance
+Linker
+ ++The linker in Go 1.5 is now one Go program, +that replaces
+ +6l
,8l
, etc. +Its operating system and instruction set are specified +by the environment variablesGOOS
andGOARCH
. ++There are a couple of other changes. +The more significant is the addition of a
-buildmode
option that +expands the style of linking; it now supports +situations such as building shared libraries and allowing other languages +to call into Go libraries. +Some of these were outlined in a design document. +For a list of the available build modes and their use, run +- -cmd/gc: evaluate concrete == interface without allocating (https://golang.org/cl/2096) -cmd/gc: optimize memclr of slices and arrays (https://golang.org/cl/2520) -cmd/gc: transform closure calls to function calls (https://golang.org/cl/4050) -cmd/gc: transitive inlining (https://golang.org/cl/5952) -cmd/gc, runtime: speed up some cases of _, ok := i.(T) (https://golang.org/cl/7697) -cmd/gc: speed up large string switches (https://golang.org/cl/7698) -cmd/gc: inline x := y.(*T) and x, ok := y.(*T) (https://golang.org/cl/7862) -cmd/gc: allocate backing storage for non-escaping interfaces on stack (https://golang.org/cl/8201) -encoding/xml: avoid an allocation for tags without attributes (https://golang.org/cl/4160) -image: many optimizations -runtime: add ARM runtime.cmpstring and bytes.Compare (https://golang.org/cl/8010) -runtime: do not scan maps when k/v do not contain pointers (https://golang.org/cl/3288) -runtime: reduce thrashing of gs between ps (https://golang.org/cl/9872) -sort: number of Sort performance optimizations (https://golang.org/cl/2100, https://golang.org/cl/2614, ...) -strconv: optimize decimal to string conversion (https://golang.org/cl/2105) -strconv: optimize float to string conversion (https://golang.org/cl/5600) -sync: add active spinning to Mutex (https://golang.org/cl/5430) -math/big: faster assembly kernels for amd64 and 386 (https://golang.org/cl/2503, https://golang.org/cl/2560) -math/big: faster "pure Go" kernels for platforms w/o assembly kernels (https://golang.org/cl/2480) -regexp: port RE2's bitstate backtracker to the regexp package (https://golang.org/cl/2153) +$ go help buildmode-Core library
++Another minor change is that the linker no longer records build time stamps in +the header of Windows executables. +Also, although this may be fixed, Windows cgo executables are missing some +DWARF information. +
+ +Go command
+ ++The
+ +go
command's basic operation +is unchanged, but there are a number of changes worth noting. ++The previous release introduced the idea of a directory internal to a package +being unimportable through the
+ +go
command. +In 1.4, it was tested with the introduction of some internal elements +in the core repository. +As suggested in the design document, +that change is now being made available to all repositories. +The rules are explained in the design document, but in summary any +package in or under a directory namedinternal
may +be imported by packages rooted in the same subtree. +Existing packages with directory elements namedinternal
may be +inadvertently broken by this change, which was why it was advertised +in the last release. ++Another change in how packages are handled is the experimental +addition of support for "vendoring". +TODO: This is undocumented in the go command itself. +TODO: Preliminary design in https://golang.org/s/go15vendor should be updated. +
+ ++There have also been several minor changes. +Read the documentation for full details. +
+ +
.swig
and .swigcxx
+now require SWIG 3.0.6 or later.
+std
(standard library) wildcard package name
+now excludes commands.
+A new cmd
wildcard covers the commands.
+-toolexec
flag for building
+allows substitution of a different command to invoke
+the compiler and so on.
+This acts as a custom replacement for go tool
.
+-buildmode
option tied to the linker,
+as described above.
+-asmflags
build option has been added to provide
+flags to the assembler.
+However,
+the -ccflags
build option has been dropped. TODO: why?
+generate
subcommand has a couple of new features.
+The -run
option specifies a regular expression to select which directives
+to execute; this was proposed but never implemented in 1.4.
+The executing pattern now has access to two new environment variables:
+$GOLINE
returns the source line number of the directive
+and $DOLLAR
expands to a dollar sign.
+
+The go tool vet
command now does
+more thorough validation of struct tags.
+
+TODO +cmd/trace: new command to view traces (https://golang.org/cl/3601) ++ +
+A few releases back, the go doc
+command was deleted as being unnecessary.
+One could always run "godoc .
" instead.
+The 1.5 release introduces a new go doc
+command with a more convenient command-line interface than
+godoc
's.
+It is designed for command-line usage specifically, and provides a more
+compact and focused presentation of the documentation for a package
+or its elements, according to the invocation.
+It also provides case-insensitive matching and
+support for showing the documentation for unexported symbols.
+For details run "go help doc
".
+
+When parsing #cgo
lines,
+the invocation ${SRCDIR}
is now
+expanded into the path to the source directory.
+This allows options to be passed to the
+compiler and linker that involve file paths relative to the
+source code directory. Without the expansion the paths would be
+invalid when the current working directory changes.
+
+On Windows, cgo now uses external linking by default. +
+ ++As always, the changes are so general and varied that precise statements +about performance are difficult to make. +The changes are even broader ranging than usual in this release, which +includes a new garbage collector and a conversion of the runtime to Go. +Some programs may run faster, some slower. +On average the programs in the Go 1 benchmark suite run a few percent faster in Go 1.5 +than they did in Go 1.4, +while as mentioned above the garbage collector's pauses are +dramatically shorter, and almost always under 10 milliseconds. +
+ ++Builds in Go 1.5 will be slower by a factor of about two. +The automatic translation of the compiler and linker from C to Go resulted in +unidiomatic Go code that performs poorly compared to well-written Go. +Analysis tools and refactoring helped to improve the code, but much remains to be done. +Further profiling and optimization will continue in Go 1.6 and future releases. +For more details, see these slides +and associated video. +
+ +crypto/tls
package
now supports Signed Certificate Timestamps (SCTs) as specified in RFC 6962.
The server serves them if they are listed in the
Certificate
struct,
-and the client reqeusts them and exposes them, if present,
+and the client requests them and exposes them, if present,
in its ConnectionState
struct.
The crytpo/tls
server implementation
will also now always call the