Lune

OOPSLA2022顶会

Generic go to go: dictionary-passing, monomorphisation, and hybrid

Stephen Ellis, Shuofei Zhu, Nobuko Yoshida, Linhai Song

摘要

Go is a popular statically-typed industrial programming language. To aid the type safe reuse of code, the recent Go release (Go 1.18) published early 2022 includes bounded parametric polymorphism via generic types. Go 1.18 implements generic types using a combination of monomorphisation and call-graph based dictionary-passing called hybrid. This hybrid approach can be viewed as an optimised form of monomorphisation that statically generates specialised methods and types based on possible instantiations. A monolithic dictionary supplements information lost during monomorphisation, and is structured according to the program’s call graph. Unfortunately, the hybrid approach still suffers from code bloat, poor compilation speed, and limited code coverage. In this paper we propose and formalise a new non-specialising call-site based dictionary-passing translation. Our call-site based translation creates individual dictionaries for each type parameter, with dictionary construction occurring in place of instantiation, overcoming the limitations of hybrid. We prove it correct using a novel and general bisimulation up to technique. To better understand how different generics translation approaches work in practice, we benchmark five translators, Go 1.18, two existing monomorphisation translators, our dictionary-passing translator, and an erasure translator. Our findings reveal several suggestions for improvements for Go 1.18— specifically how to overcome the expressiveness limitations of generic Go and improve compile time and compiled code size performance of Go 1.18.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 2 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Extending Isabelle/HOL's Code Generator with Support for the Go Programming Language 引用了 Featherweight go
  • Welterweight Go: Boxing, Structural Subtyping, and Generics 引用了 Featherweight go
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper2

  1. Extending Isabelle/HOL's Code Generator with Support for the Go Programming LanguageTerru Stübinger, Lars HupelFM 2024 · 1 次引用
  2. Welterweight Go: Boxing, Structural Subtyping, and GenericsRaymond Hu, Julien Lange, Bernardo Toninho, Philip Wadler 等POPL 2026

它引用的 Paper1

  1. Featherweight goRobert Griesemer, Raymond Hu, Wen Kokke, Julien Lange 等OOPSLA 2020 · 16 次引用

相关 Paper

  1. The Simple Essence of MonomorphizationMatthew Lutze, Philipp Schuster, Jonathan Immanuel BrachthäuserOOPSLA 2025 · 2 次引用
  2. Class-Dictionary Specialization with Rank-2 Polymorphic FunctionsYong Qi Foo, Michael D. AdamsOOPSLA 2026
  3. Measuring the Impact of Programming Language DistributionGabriel Orlanski, Kefan Xiao, Xavier Garcia, Jeffrey Hui 等ICML 2023 · 49 次引用
  4. Automated Verification of Go Programs via Bounded Model CheckingNicolas Dilley, Julien LangeASE 2021 · 21 次引用
  5. Bounded Sort Polymorphism with Elimination ConstraintsJohann Rosain, Tomás Díaz, Kenji Maillard, Matthieu Sozeau 等POPL 2026
黄昏的海面,两侧是细线勾勒的悬崖