Go programming language release 1.13

Submitted by programming language release Go 1.13, which is developed by Google with the participation of the community as a hybrid solution that combines the high performance of compiled languages ​​​​with the advantages of scripting languages ​​\uXNUMXb\uXNUMXbsuch as ease of writing code, speed of development, and error protection. Project code spreads under the BSD license.

The syntax of Go is based on the familiar elements of the C language with some borrowings from the Python language. The language is quite concise, but the code is easy to read and understand. Go code is compiled into standalone binary executable files that run natively without using a virtual machine (profiling, debugging, and other run-time problem detection subsystems are integrated as runtime components), which allows you to achieve performance comparable to programs in the C language.

The project is initially developed with an eye on multi-threaded programming and efficient operation on multi-core systems, including providing means implemented at the operator level for organizing parallel computing and interaction between parallelly executed methods. The language also provides built-in protection against overruns of allocated memory blocks and provides the ability to use the garbage collector.

All innovations, introduced in the Go 1.13 release:

  • The crypto/tls package has protocol support enabled by default TLS 1.3. Added new package "crypto/ed25519" with support for Ed25519 digital signatures;
  • Added support for new numeric literal prefixes to define binary numbers (eg 0b101), octal (0o377), imaginary (2.71828i) and hexadecimal floating point (0x1p-1021), and the ability to use the "_" character to visually separate digits in large numbers (1_000_000);
  • The restriction on using only unsigned counters in shift operations has been removed, which avoids unnecessary conversions to the uint type before using the “‹‹” and “››” operators;
  • Added support for the Illumos platform (GOOS=illumos). Compatibility with the Android 10 platform has been ensured. The requirements for the minimum versions of FreeBSD (11.2) and macOS (10.11 “El Capitan”) have been increased.
  • Continued development of the new module system, which can be used as an alternative to GOPATH. Contrary to previously announced plans in Go 1.13, this system is not enabled by default and requires activation through the GO111MODULE=on variable or the use of a context in which modules are applied automatically. The new module system features integrated versioning support, package delivery capabilities, and improved dependency management. With modules, developers are no longer tied to working within a GOPATH tree, can explicitly define versioned dependencies, and create repeatable builds.

    Unlike previous releases, automatic application of the new system now works when a go.mod file is present in the current working directory or parent directory when running the go command, including when it is in the GOPATH/src directory. New environment variables have been added: GOPRIVATE, which defines the paths of publicly accessible modules, and GOSUMDB, which specifies access parameters to the checksum database for modules not listed in the go.sum file;

  • The "go" command by default loads modules and checks their integrity using the module mirror and checksum database maintained by Google (proxy.golang.org, sum.golang.org and index.golang.org);
  • Support for only binary packages has been discontinued; building a package in the “//go:binary-only-package” mode now results in an error;
  • Added support for the "@patch" suffix to the "go get" command, indicating that the module should be updated to the latest maintenance release, but without changing the current major or minor version;
  • When retrieving modules from source control systems, the "go" command now performs an additional check on the version string, attempting to match pseudo-version numbers with metadata from the repository;
  • Added support error inspection (error wrapping) through the creation of wrappers that allow the use of standard error handlers. For example, bug "e" can be wrapped around error "w" by providing a method Unwrap, returning "w". Both errors "e" and "w" are available in the program and decisions are made based on error "w", but "e" provides additional context to "w" or interprets it differently;
  • The performance of runtime components has been optimized (a speed increase of up to 30% has been noted) and a more aggressive return of memory to the operating system has been implemented (previously, memory was returned after five or more minutes, but now immediately after reducing the heap size).

Source: opennet.ru

Add a comment