A Lightweight Optimization Technique for Data Types à la Carte (bibtex)
by Hirotada Kiriyama, Tomoyuki Aotani and Hidehiko Masuhara
Abstract:
Data types a la carte (DTC) is a technique for adding new variants to data types modularly. A drawback of DTC compared with simple variant types, which are commonly used to define data types in functional programming languages, is runtime inefficiency caused by the destruction of these values. In this paper, we propose a lightweight optimization technique for functions that destruct the values of DTC data types. It makes their execution as efficient as their non-DTC counterparts by just (1) deriving non-extensible algebraic data types isomorphic to extensible data types defined in DTC fashion and (2) using them within the type annotations that specify concrete data types using the composition operator given in DTC. The approach is based on an insight on the functions: the functions never depend on any concrete data types but merely constrain them. We implemented functions that take an extensible data type defined in DTC fashion and derive an isomorphic non-extensible algebraic data type using Template Haskell. Our experimental results show that DTC functions using our approach run as efficiently as their non-DTC counterparts and avoid performance slow down even if the data types are extended multiple times.
Reference:
A Lightweight Optimization Technique for Data Types à la Carte (Hirotada Kiriyama, Tomoyuki Aotani and Hidehiko Masuhara), In Proceedings of the Workshop on Language Modularity À La Mode Workshop (LaMOD'16), included in Companion Proceedings of International Conference on Modularity (Raffi Khatchadourian, David H. Lorenz, Jacques Noyé, eds.), ACM, 2016.
Bibtex Entry:
@inproceedings{kiriyama2016lamod,
  publisher = {{ACM}},
  month = mar,
  location = {M{\'a}laga, Spain},
  editor = {Raffi Khatchadourian and David H. Lorenz and Jacques Noy{\'e}},
  year = 2016,
  booktitle = {Proceedings of the Workshop on Language Modularity {\`A} La Mode Workshop (LaMOD'16), included in Companion Proceedings of International Conference on Modularity},
  author = {Hirotada Kiriyama and Tomoyuki Aotani and Hidehiko Masuhara},
  title = {A Lightweight Optimization Technique for Data Types {\`a} la Carte},
  pdf = {lamod2016-alacarte.pdf},
  pages = {86--90},
  doi = {10.1145/2892664.2892677},
  abstract = {Data types a la carte (DTC) is a technique for adding new variants to data types modularly. A drawback of DTC compared with simple variant types, which are commonly used to define data types in functional programming languages, is runtime inefficiency caused by the destruction of these values. In this paper, we propose a lightweight optimization technique for functions that destruct the values of DTC data types. It makes their execution as efficient as their non-DTC counterparts by just (1) deriving non-extensible algebraic data types isomorphic to extensible data types defined in DTC fashion and (2) using them within the type annotations that specify concrete data types using the composition operator given in DTC. The approach is based on an insight on the functions: the functions never depend on any concrete data types but merely constrain them. We implemented functions that take an extensible data type defined in DTC fashion and derive an isomorphic non-extensible algebraic data type using Template Haskell. Our experimental results show that DTC functions using our approach run as efficiently as their non-DTC counterparts and avoid performance slow down even if the data types are extended multiple times.}
}
Powered by bibtexbrowser