Functional prototypes for generic C++ libraries: a transformational approach based on higher-order, typed signatures

被引:0
作者
Daniel Lincke
Sibylle Schupp
Cezar Ionescu
机构
[1] Global Climate Forum,Institute for Software Systems
[2] Hamburg University of Technology,Research Domain Transdisciplinary Concepts and Methods
[3] Potsdam Institute for Climate Impact Research (PIK),undefined
来源
International Journal on Software Tools for Technology Transfer | 2015年 / 17卷
关键词
Defunctionalization; Higher-order functions; Type constructors; Concepts; Program transformation;
D O I
暂无
中图分类号
学科分类号
摘要
This paper presents a method for developing generic C++ software libraries from functional prototypes, based on program transformation. More precisely, the type signatures of generic functions, i.e., functions parameterized on types, are transformed. This transformation maps type-level expressions from functional higher-order, typed languages to type-level expressions in C++. In particular, type-level functional constructs such as higher-order functions and type constructors, are mapped to type parameters of generics that are constrained with appropriate concepts. The core of the transformation is a novel form of “defunctionalization” at the level of types. To make the transformation retargetable, we based it on two kernel languages that can be bound to different functional and object-oriented languages. For this paper, we use bindings to Haskell as front end and C++ with concepts as back end. Our transformational approach presents an alternative to a language extension and is useful particularly for functional prototyping where functional features are employed at specification time. We illustrate our approach by a case study: we show how we developed a generic C++ library for vulnerability modeling in the context of global change from a functional prototype in Haskell.
引用
收藏
页码:91 / 105
页数:14
相关论文
共 33 条
[1]  
Bagge AH(2009)Axiom-based transformations: optimisation and testing Electron. Notes Theor. Comput. Sci. 238 17-33
[2]  
Haveraaen M(2007)Relation-based computations in a monadic BSP model Parallel Comput. 33 795-821
[3]  
Botta N(2010)Generic programming with C++ concepts and Haskell type classes: a comparison J. Funct. Program. 20 271-302
[4]  
Ionescu C(2011)A functional framework for agent-based models of exchange Appl. Math. Comput. 218 4025-4040
[5]  
Bernardy J.(2007)An extended comparative study of language support for generic programming J. Funct. Program. 17 145-205
[6]  
Jansson P.(2006)Resilience, vulnerability and adaptation: a cross-cutting theme of the international human dimensions programme on global environmental change Glob. Environ. Chang. 16 237-239
[7]  
Zalewski M.(2003)The lambda library unnamed functions in C++ Softw. Pract. Exp. 33 259-291
[8]  
Schupp S.(2013)Clarifying vulnerability definitions and assessments using formalisation Int. J. Clim. Chang. Strateg. Manag. 5 54-70
[9]  
Priesnitz A.(undefined)undefined undefined undefined undefined-undefined
[10]  
Botta N(undefined)undefined undefined undefined undefined-undefined