Title
Late data layout: unifying data representation transformations
Abstract
Values need to be represented differently when interacting with certain language features. For example, an integer has to take an object-based representation when interacting with erased generics, although, for performance reasons, the stack-based value representation is better. To abstract over these implementation details, some programming languages choose to expose a unified high-level concept (the integer) and let the compiler choose its exact representation and insert coercions where necessary. This pattern appears in multiple language features such as value classes, specialization and multi-stage programming: they all expose a unified concept which they later refine into multiple representations. Yet, the underlying compiler implementations typically entangle the core mechanism with assumptions about the alternative representations and their interaction with other language features. In this paper we present the Late Data Layout mechanism, a simple but versatile type-driven generalization that subsumes and improves the state-of-the-art representation transformations. In doing so, we make two key observations: (1) annotated types conveniently capture the semantics of using multiple representations and (2) local type inference can be used to consistently and optimally introduce coercions. We validated our approach by implementing three language features as Scala compiler extensions: value classes, specialization (using the miniboxing representation) and a simplified multi-stage programming mechanism.
Year
DOI
Venue
2014
10.1145/2660193.2660197
OOPSLA
Keywords
Field
DocType
type systems,annotated types,data representation,object-oriented,local type inference,polymorphism,object representation,object oriented
Integer,Scala,Programming language,External Data Representation,Object-oriented programming,Computer science,Theoretical computer science,Compiler,Type inference,Implementation,Semantics
Conference
Volume
Issue
ISSN
49
10
0362-1340
Citations 
PageRank 
References 
4
0.42
41
Authors
3
Name
Order
Citations
PageRank
Vlad Ureche11457.78
Eugene Burmako2482.49
Martin Odersky32261170.39