第 8 期:泛型来了!
录制时间: 2022-05-06
本期摘要:这是 Go 夜聊的第八期节目,我们和 Go 语言 101 的作者一起聊了聊期待已久的泛型,我们聊到了为什么需要泛型,设计的优点、讨论时的期望与正式发布时的失望。新出现的类型集是什么?comparable 又是什么?目前的泛型设计在未来还有多大的改进空间?
时间线
00:12 开场
01:10 接触 Go 语言的动机
03:30 编写《Go 101》的原因
04:42 活跃在 Go 语言社区
09:27 独立游戏的行业经历
12:11 用 Go 语言做游戏
13:51 泛型产生的动机,与 Go Generate 的对比
20:21 接口、类型集、类型约束的关系
28:36 类型集与泛型的关系
30:40 接口与类型集是同一个概念吗?
31:34 comparable 类型、它能解决什么问题、它还有哪些争议
37:42 接口作为值类型
42:45 泛型设计的其他优点
48:10 泛型设计的缺点
58:09 泛型设计的限制
66:09 对泛型未来的期望与失望
68:20 Go 团队排外吗?
71:35 Go 语言 101 背后的故事
83:38 结尾推荐
87:55 尾声
相关链接
proposal: spec: permit non-interface types that support == to satisfy the comparable constraint)
proposal: spec: allow interface types to instantiate comparable type parameters)
proposal: type parameters are comparable unless they exclude comparable types)
proposal: the comparable interface represents the comparable subset of run-time values)
灿烂千阳)
群山回唱)
📝 联系我们