Generic Go to Go: Dictionary-Passing, Monomorphisation, and Hybrid
summary
Proposes a new dictionary-passing translation for Go generics that is type-, error- and value-preserving and proven correct by a novel bisimulation up to dictionary resolution; implements it as dict and Eurasia and benchmarks five translators (Go 1.18, two monomorphisers, dict, erasure). Monomorphisation produces exponential code growth and very slow compilation; dict and erasure scale polynomially, yield smaller binaries on real programs but often slower execution than monomorphised output, and mono shows the worst compile-time cost.
AI-written summary · about
chapters (13)
- 0:00Generic Go introduction
- 2:07Featherweight Go basics
- 5:38Dictionary passing overview
- 8:49Correctness proof
- 9:54Evaluation setup
- 13:29Benchmark results
- 13:50Conclusion
- 14:56Q&A: receiver subtyping
- 17:30Q&A: performance slowdowns
- 18:59Q&A: unsafe.Pointer for dicts
- 20:04Q&A: interface dicts vs performance
- 21:50Q&A: compiler optimizations
- 22:36Q&A: real-world generics








