Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Just do it while compiling!: Fast extensible records in Haskell
Martinez B., Viera M., Pardo A.  PEPM 2013 (Proceedings of the ACM SIGPLAN 2013 Workshop on Partial Evaluation and Program Manipulation, Rome, Italy, Jan 21, 2013)77-86.2013.Type:Proceedings
Date Reviewed: Jul 2 2013

Almost all programming languages have some kind of record data structure. While the theory is fairly well understood (they are labeled products, which can be considered open or closed depending on one’s typing rules), the pragmatics are still hotly debated. This is especially apparent in Haskell, where the community generally agrees that its record system is poor while emphatically disagreeing on a better solution. Exploring this design space through concrete implementations is thus quite important.

One of the principal features missing from Haskell’s record system is extensibility of records. Currently, every label used in a record must be unique (within a module), which is generally recognized as problematic. Unlike in the OCaml language, Haskell does not use row typing for its records. Many people have noticed that this could be implemented in Haskell now, using its class system. The downside is that record look-up then becomes linear in the number of labels of that record.

The authors of this paper point out that the label information for records is available at compile time, thus providing an opportunity for compile-time computations to optimize the look-up process.

What is then presented is a beautiful application of staging, the process of cleanly separating compile-time computations from runtime computations. The authors show that with rather clever type class-level programming, one can indeed implement extensible records in Haskell, with good efficiency properties.

While the English in this paper is somewhat awkward throughout, the technical material is of high quality, and is well motivated and presented. Unfortunately for the authors, Haskell is a quickly evolving language, and several new features of the Glasgow Haskell Compiler (GHC) may well render their technical solution suboptimal.

Nevertheless, the fundamental techniques that they apply are sound and worth knowing, even if some of the implementation details will likely have to evolve.

Reviewer:  Jacques Carette Review #: CR141330 (1309-0816)
Bookmark and Share
  Featured Reviewer  
 
Haskell (D.3.2 ... )
 
 
Applicative (Functional) Programming (D.1.1 )
 
 
Language Constructs and Features (D.3.3 )
 
Would you recommend this review?
yes
no
Other reviews under "Haskell": Date
Lava: hardware design in Haskell
Bjesse P., Claessen K., Sheeran M., Singh S. ACM SIGPLAN Notices 34(1): 174-184, 1999. Type: Article
Aug 27 2004
Programming in Haskell
Hutton G., Cambridge University Press, New York, NY, 2007.  184, Type: Book (9780521692694), Reviews: (1 of 2)
Aug 11 2008
Programming in Haskell
Hutton G., Cambridge University Press, New York, NY, 2007.  184, Type: Book (9780521692694), Reviews: (2 of 2)
Sep 19 2008
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy