Go 1.19 improves generics, memory model

Go 1.19, the latest version of Google’s Go (Golang) programming language, has reached production availability. The update improves recently added generics and debuts an enhanced memory model.

With Go 1.19, released August 2, generics development focused on addressing subtle issues and corner cases reported by the community as well as performance improvements (as much as 20% in some generic programs). Long-sought generics capabilities were added to the language with Go 1.18, which was released in March.

The Go memory model, meanwhile, now explicitly defines the behavior of the sync/atomic package, providing low-level atomic memory primitives for implementing synchronization algorithms. The formal definition of the happens-before relation has been revised to align with memory models used by C, C++, Java, JavaScript, Rust, and Swift. Existing programs are not affected. In addition to the memory model update, there are new types in the sync/atomic package, such as atomic.int64 and atomic.Pointer(T), making it easier to use atomic values.

To read this article in full, please click here

Social media & sharing icons powered by UltimatelySocial