Google has presented the release of the programming language Go 1.21, which is being developed by Google with community participation. Go 1.21 is a hybrid solution that combines the high performance of compiled languages with the ease of coding, speed of development, and security from errors offered by script languages. The project code is distributed under the BSD license.
The syntax of Go is based on the usual elements of the SI language with some influence from the language of Oberon. While the language is concise, the code is easily readable and understandable. Code in Go is compiled into separate binary executable files which are executed natively, without the use of a virtual machine. Runtime components such as profiling modules and debugging subsystems are integrated to identify problems during execution. This allows Go to achieve performance comparable to programs in SI.
The project is specifically designed for multi-flow programming and effective work on multi-core systems. It includes means for organizing parallel calculations and interaction between parallel methods. Go also provides built-in protection against going beyond the permissible areas of dedicated memory blocks and features a garbage collector.
Among the changes in the new Go 1.21 release:
- Implemented support for optimization based on the results of code profiling (PGO – Profile-guided Optimization). This feature takes into account the performance profile during assembly and can increase application performance by 2-7%. Optimization is automatically included when the Default.pgo file, prepared by the PPROF utility, is present during assembly. The -pgo option allows for the selection of another profile.
- The utility go now ensures direct and reverse compatibility with other versions of the Go language. This enables the use of old tools for assembling new code and vice versa.
- Built-in functions min and max have been added. These functions allow for the selection of the smallest or greatest value. The function Clear has also been added to remove or zero all elements in the structures of