Lune

POPL2026顶会

Welterweight Go: Boxing, Structural Subtyping, and Generics

Raymond Hu, Julien Lange, Bernardo Toninho, Philip Wadler, Robert Griesemer, Keith Randall

摘要

Go's unique combination of structural subtyping between generics and types with non-uniform runtime representations presents significant challenges for formalising the language.

We introduce WG (Welterweight Go), a core model of Go that captures key features excluded by prior work, including underlying types, type unions and type sets, and proposed new features, such as generic methods. We also develop LWG, a lower-level language that models Go's runtime mechanisms, notably the distinction between raw struct values and interface values that carry runtime type information (RTTI).

We give a type-directed compilation from WG to LWG that demonstrates how the proposed features can be implemented while observing important design and implementation goals for Go: compatibility with separate compilation, and no runtime code generation. Unlike existing approaches based on static monomorphisation, our compilation strategy uses runtime type conversions and adaptor methods to handle the complex interactions between structural subtyping, generics, and Go's runtime infrastructure.

问 Lune

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

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

可以从这些问题问起

Lune 可以查阅

全文 · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Generic go to go: dictionary-passing, monomorphisation, and hybrid 引用了 Featherweight go
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

它引用的 Paper2

  1. Featherweight goRobert Griesemer, Raymond Hu, Wen Kokke, Julien Lange 等OOPSLA 2020 · 16 次引用
  2. Generic go to go: dictionary-passing, monomorphisation, and hybridStephen Ellis, Shuofei Zhu, Nobuko Yoshida, Linhai SongOOPSLA 2022 · 4 次引用

相关 Paper

  1. Beyond Nominality: Faster Rapid Type Analysis in the Presence of Structural SubtypingElton Pinto, Milind ChabbiOOPSLA 2026
  2. Implementing Set-Theoretic TypesMickaël Laurent, Kim NguyễnOOPSLA 2026 · 1 次引用
  3. Automated Verification of Go Programs via Bounded Model CheckingNicolas Dilley, Julien LangeASE 2021 · 21 次引用
  4. A Formal Account of the Wasm 3.0 Concurrency ModelAzalea Raad, Michalis Kokologiannakis, Viktor Vafeiadis, Conrad WattOOPSLA 2026
  5. Code Translation with Compiler RepresentationsMarc Szafraniec, Baptiste Rozière, Hugh Leather, Patrick Labatut 等ICLR 2023 · 18 次引用
黄昏的海面,两侧是细线勾勒的悬崖