Programming language: Go 1.24 supports WebAssembly and generic type aliases
Go 1.24 introduces new features and performance optimizations as well as adjustments to the tools and the standard library. WebAssembly support is growing.
(Image: jakkaje879/Shutterstock.com)
The Go programming language has received an update: Version 1.24 is now available. This version brings numerous new features and optimizations that affect language support as well as performance, tools and the standard library.
Developers can look forward to full support for generic type aliases, improved efficiency in the runtime environment and revised tools. In addition, the update offers important enhancements to the standard library and support for WebAssembly has been further expanded.
Support for generic type aliases
Developers can now take advantage of full support for generic type aliases, which enables the parameterization of type aliases. Performance improvements have been implemented in the runtime environment which, according to the announcement, should reduce CPU load by an average of 2 to 3 percent. A new map implementation, more efficient memory allocations and a new internal mutex implementation contribute to this.
Revision of the tools
In Go 1.24, the development team has made changes to the tools. The go command now provides a new mechanism for tracking tool dependencies within a module. The go get -tool command can be used to add a tool directive to the current module and go tool [tool name] can be used to execute the tools that have been declared with this directive.
The update also adds a new test analyzer to the go vet subcommand, which is intended to report common errors in the declarations of tests, fuzzers, benchmarks and examples in test packages.
Videos by heise
New features for the standard library
There are several new features in the Go 1.24 standard library. These include the introduction of new mechanisms to support the FIPS-140-3 encryption standards defined by the National Institute of Standards and Technology (NIST), which make it possible to use approved algorithms without making changes to the source code of the applications.
Furthermore, the update provides some packages for the standard library that were previously included in the x/crypto module, which should simplify access to these functions.
In addition, the development team is establishing the testing.B.Loop method, which is intended to make benchmarks more efficient and less error-prone by replacing conventional loop structures. The new os.Root type allows file system operations to be carried out securely and isolated within a specific directory. In addition, the runtime environment offers a new, more flexible and efficient finalization mechanism with runtime.AddCleanup, which is less error-prone than the previous runtime.SetFinalizer, according to the blog post.
Support for WebAssembly
For WebAssembly, Go 1.24 introduces the go:wasmexport directive, which allows functions to be exported to the WebAssembly host. The creation of Go programs as a WASI reactor/library is also supported.
Further information on Go 1.24 can be found in the announcement post on the Go blog.
(mdo)