Existentialize Your Generics
The two main approaches to compile generic programs are dynamic dispatch and monomorphization. While the latter is typically preferred in the context of low latency applications, where the overhead of boxing may be prohibitive, it also comes at the cost of important limitations in terms of modularity, expressiveness, and code size. The Swift programming language proposes an interesting third alternative that addresses these shortcomings, supporting dynamic dispatch without requiring boxing by factoring method tables out of object headers. This paper examines the merits of that strategy, which we call existentialization, across different programming languages. Our study shows that existentialization can produce code with competitive performance with respect to monomorphization.
3759426.3760975.pdf
Main Document
Accepted version
openaccess
N/A
583.03 KB
Adobe PDF
d1598c39ab111607034d65933237f69f