Published September 24, 2020 | Version v1
Software Open

Featherweight Go (Artifact)

  • 1. Google
  • 2. University of Hertfordshire
  • 3. University of Edinburgh
  • 4. Royal Holloway, University of London
  • 5. Universidade Nova de Lisboa and NOVA-LINCS
  • 6. Imperial College London

Description

This paper presents Featherweight Go (FG) and Featherweight Generic Go (FGG), a core calculus of Go and a proposal for extending it with F-bounded polymorphism. The calculi are in the same vein as Featherweight Java (FJ), but where Featherweight Generic Java (FGJ) was translated into FJ via erasure, FGG translates into FG via monomorphization (which is also formalized). The two calculi are proven sound using the normal progress and preservation arguments. Additionally a bisimulation is shown to exist between a FGG program and its monomorphization (if it exists); in other words that monomorphization preserves the semantics of the program.

The artifact consists of an implementation of type checkers and interpreters for FG and FGG, as well as a monomorphization procedure (including the check if it is possible). It includes the examples from the paper, and a comparison using the Go compiler as reference. Type preservation and bisimulation for these programs are tested dynamically. Additionally, the same is tested for all well-typed programs up to a certain size (which are generated in a manner similar to property-based testing).

Files

Files (1.2 GB)

Name Size Download all
md5:19b85395f0f3b1ccbef7a1516cbfaccc
1.2 GB Download