From HOT to COOL: transforming higher-order typed languages to concept-constrained object-oriented languages

  • Authors:
  • Daniel Lincke;Sibylle Schupp

  • Affiliations:
  • Potsdam Institute for Climate Impact Research (PIK), Germany;Hamburg University of Technology, Germany

  • Venue:
  • Proceedings of the Twelfth Workshop on Language Descriptions, Tools, and Applications
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

In this paper, we present a transformation that maps type-level expressions from functional higher-order, typed (HOT) languages to type-level expressions in object-oriented HOT languages by mapping higher-order types to type parameters of generics that are constrained with appropriate concepts. We introduce a novel form of "defunctionalization" and a correctness criterion based on the kind structure of the transformed expression, and show that our transformation preserves kind structure. The transformation is retargetable, based on two new kernel languages that can be bound to different functional and object-oriented languages; we already provide bindings to Haskell as front end and C++ concepts and Scala traits in the back ends. The transformational approach presents an alternative to a language extension and is useful in particular if functional features are employed at specification time. We motivate the approach and illustrate it using three sizable functional libraries in C++ that have signatures that are automatically generated from the corresponding Haskell signatures.