A Type-Directed, Dictionary-Passing Translation of Method Overloading and Structural Subtyping in Featherweight Generic Go
Martin Sulzmann, Stefan Wehr

TL;DR
This paper presents a type-directed, dictionary-passing translation of Featherweight Generic Go, enabling method overloading and structural subtyping to be understood through an untyped lambda calculus, simplifying dynamic method resolution.
Contribution
It introduces a novel translation from FGG to an untyped lambda calculus, demonstrating how method overloading and subtyping can be handled via dictionary passing, with formal proof of semantic preservation.
Findings
Translation preserves dynamic semantics of FGG programs.
Method calls are resolved via dictionary lookup, simplifying implementation.
Proof uses a step-indexed logical relation for recursive types.
Abstract
Featherweight Generic Go (FGG) is a minimal core calculus modeling the essential features of the programming language Go. It includes support for overloaded methods, interface types, structural subtyping and generics. The most straightforward semantic description of the dynamic behavior of FGG programs is to resolve method calls based on runtime type information of the receiver. This article shows a different approach by defining a type-directed translation from FGG- to an untyped lambda-calculus. FGG- includes all features of FGG but type assertions. The translation of an FGG- program provides evidence for the availability of methods as additional dictionary parameters, similar to the dictionary-passing approach known from Haskell type classes. Then, method calls can be resolved by a simple lookup of the method definition in the dictionary. Every program in the image of the…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Artificial Intelligence in Games · Parallel Computing and Optimization Techniques
