Go programming language release 1.14

Submitted by programming language release Go 1.14, 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.14 release:

  • The new module system in the "go" command is declared ready for general use, enabled by default, and recommended for dependency management instead of GOPATH. The new module system features integrated versioning support, package delivery tools, 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.
  • Added by support for inlining interfaces with an overlapping set of methods. Methods from a built-in interface can now have the same names and the same signature as methods in already present interfaces. Explicitly declared methods remain unique as before.
  • The performance of the "defer" expression has been improved, the use of which is now almost as fast as the direct call of a deferred function, which allows the use of delayed function launch in performance-sensitive code.
  • Asynchronous preemption of coroutines (goroutine) is provided - loops that do not contain function calls now potentially cannot lead to a scheduler deadlock or delay the start of garbage collection.
  • The efficiency of the memory page allocation system has been improved, with significantly fewer lock conflicts in configurations with large GOMAXPROCS values. As a result, latency has decreased and throughput has increased with parallel intensive distribution of large blocks of memory.
  • Locks have been optimized and the number of context switches has been reduced when running internal timers used in the time.After, time.Tick, net.Conn.SetDeadline functions.
  • In the go command, the "-mod=vendor" flag is enabled by default if there is a vendor directory in the root, which is intended for supplying external dependencies tied to a particular vendor. Added a separate "-mod=mod" flag to load modules from the module cache instead of from the "vendor" directory. If the go.mod file is read-only, the "-mod=readonly" flag is provided by default if there is no "vendor" top directory. Added "-modfile=file" flag to specify an alternative go.mod file instead of the one in the module's root directory.
  • Added GOINSECURE environment variable so that when set, the go command does not require the use of HTTPS and skips certificate verification when loading modules directly.
  • The flag "-d=checkptr" enabled by default has been added to the compiler to check the code for compliance with the rules for the safe use of unsafe.Pointer.
  • New package included hash/maphash with non-cryptographic hash functions to create hash tables for arbitrary byte sequences or strings.
  • Added experimental support for 64-bit RISC-V on Linux.
  • Added support for FreeBSD on 64-bit ARM systems.

Source: opennet.ru

Add a comment