RC RANDOM CHAOS

Go 1.27 Lands: Generic Methods, JSON v2, and Post-Quantum Crypto

· via Hacker News

Original source

Go 1.27

Hacker News →

Go 1.27 delivers the language’s most substantial feature additions in several releases. The spec now permits generic methods, letting a single method like Rand.N work across all integer types instead of requiring a separate variant per type. Struct literals can address fields in nested or embedded structs directly, and type inference has been extended so generic functions can be used without explicit type arguments in composite literals, conversions, and channel sends. Tooling gets a lift too, with new go fix modernizers, versioned go doc queries, and a go mod tidy that normalizes require blocks.

On the runtime side, size-specialized allocation cuts the cost of small-object (<80B) allocations by up to 30%, yielding roughly a 1% overall gain for allocation-heavy workloads, and a goroutine-leak profiler is now generally available to catch permanently blocked goroutines. The standard library sees a major overhaul of JSON handling: encoding/json/v2 introduces stricter defaults and configurable options, with the legacy encoding/json package now running on the v2 engine for faster unmarshaling while preserving compatibility.

The security-relevant headline is native post-quantum support. crypto/mldsa implements the FIPS 204 ML-DSA signature scheme and wires it into both crypto/x509 and crypto/tls, moving quantum-resistant signatures into the standard toolchain rather than third-party libraries. Rounding out the release are a native uuid package, experimental SIMD support, and an in-memory httptest server for use with synctest.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.