Go Collections工作组提出了一项提案,旨在为Go 1.28版本的标准库container包补充通用集合数据结构1。该工作组成立于2025年末,由Jonathan Amsterdam、Alan Donovan、Robert Griesemer等7人组成1。
提案涵盖多个新类型,包括container包下的hash.Map、hash.Set、set.Set、ordered.Map以及heap/v2.Heap等1。这些数据结构的设计将充分利用Go 1.18引入的泛型功能和Go 1.23的迭代器特性,为标准库建立一套通用的集合API使用约定1。其中,container/ordered.Map的当前实现采用平衡二叉树,但设计本身未对具体的数据结构实现做出强制性要求1。
针对这一提案,相关功能已分别提出了多个提案编号,包括#70471(hash/maphash.Hasher)、#69559(container/hash.Map)、#80584(container/hash.Set)、#69230(container/set.Set)、#77052(container/mapset)、#60630(container/ordered.Map)和#77397(container/heap/v2.Heap)1。其中,hash/maphash.Hasher已在go1.27中发布1。该提案还引入了三个抽象约束接口类型——_AbstractCollection、_AbstractMap和_AbstractSet,用于实现跨具体集合类型的通用逻辑1。
The Go Collections working group has put forward a proposal to add generic collection data structures to the standard library for Go 1.28.1 The proposal encompasses several new types within the container package, including hash.Map, hash.Set, set.Set, ordered.Map, and heap/v2.Heap, designed to leverage generics introduced in Go 1.18 and iterators added in Go 1.23.1 These additions aim to establish standardized API conventions for commonly used collection implementations currently absent from the standard library.1
The seven-member working group, comprising Jonathan Amsterdam, Alan Donovan, Robert Griesemer, and others, was formally established in late 2025.1 The proposal consolidates multiple related proposals targeting Go 1.28, including hash/maphash.Hasher, which has already shipped in go1.27, as well as new container types such as hash.Map and ordered.Map.1 The ordered.Map implementation currently uses a balanced binary tree, though the design does not mandate this approach.1 Additionally, the proposal introduces three abstract constraint interface types—_AbstractCollection, _AbstractMap, and _AbstractSet—to enable generic implementations across concrete collection types.1
评论
还没有评论,欢迎留下第一条。