Generic Go to Go: Dictionary-Passing, Monomorphisation, and HybridPre-recorded
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.
Wed 30 NovDisplayed time zone: Auckland, Wellington change
04:00 - 05:30 | Session 1V-OOPSLA at Virtual Airmeet Room Chair(s): Amal Ahmed Northeastern University, USA, Jan Vitek Northeastern University | ||
04:00 15mTalk | Generic Go to Go: Dictionary-Passing, Monomorphisation, and HybridPre-recorded V-OOPSLA Stephen Ellis Imperial College London, Shuofei Zhu Pennsylvania State University, Nobuko Yoshida University of Oxford, Linhai Song Pennsylvania State University DOI | ||
04:15 15mResearch paper | Coverage-guided tensor compiler fuzzing with joint IR-pass mutationPre-recorded V-OOPSLA Jiawei Liu University of Illinois at Urbana-Champaign, Yuxiang Wei Tongji University, Sen Yang Fudan University, Yinlin Deng University of Illinois at Urbana-Champaign, Lingming Zhang University of Illinois at Urbana-Champaign DOI | ||
04:30 15mTalk | Modular Verification of Op-Based CRDTs in Separation Logic V-OOPSLA Abel Nieto Aarhus University, Léon Gondelman Aarhus University, Alban Reynaud ENS Lyon, Amin Timany Aarhus University, Lars Birkedal Aarhus University DOI | ||
04:45 15mTalk | Monadic and Comonadic Aspects of Dependency Analysis V-OOPSLA Pritam Choudhury University of Pennsylvania DOI | ||
05:00 30mLive Q&A | Q&A for Session 1 V-OOPSLA |