Generic go to go: dictionary-passing, monomorphisation, and hybrid
Generic go to go: dictionary-passing, monomorphisation, and hybrid
复制标题
通用 go to go:字典传递、单态化和混合
DOI:
10.1145/3563331
复制
发表时间:
2022
影响因子:
--
通讯作者:
Ellis S
中科院分区:
文献类型:
--
作者:
Ellis S
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.
登录
查看更多内容
影响因子:
19
作者:
A. Gal;Brendan Eich;Mike Shaver;David Anderson;David Mandelin;M. Haghighat;Blake Kaplan;Graydon Hoare;B. Zbarsky;Jason Orendorff;J. Ruderman;Edwin W. Smith;Rick Reitmaier;Michael Bebenita;Mason Chang;M. Franz
通讯作者:
M. Franz
DOI:
10.1145/378795.378797
发表时间:
2001-05
期刊:
--
影响因子:
--
作者:
A. Kennedy;Don Syme
通讯作者:
A. Kennedy;Don Syme
DOI:
--
发表时间:
2013
期刊:
Conference on Object-Oriented Programming Systems, Languages, and Applications
影响因子:
--
作者:
Vlad Ureche;Cristian Talau;Martin Odersky
通讯作者:
Martin Odersky
DOI:
--
发表时间:
2002
期刊:
PPPJ/IRE
影响因子:
--
作者:
Eric E. Allen;Robert Cartwright
通讯作者:
Robert Cartwright
DOI:
--
发表时间:
1997
期刊:
影响因子:
--
作者:
Martin Odersky;P. Wadler
通讯作者:
P. Wadler