Generic libraries in C++ with concepts from high-level domain descriptions in Haskell: A domain-specific library for computational vulnerability assessment
Paper in proceedings, 2009

A class of closely related problems, a problem domain, can often be described by a domain-specific language, which consists of algorithms and combinators useful for solving that particular class of problems. Such a language can be of two kinds: it can form a new language or it can be embedded as a sublanguage in an existing one. We describe an embedded DSL in the form of a library which extends a general purpose language. Our domain is that of vulnerability assessment in the context of climate change, formally described at the Potsdam Institute for Climate Impact Research. The domain is described using Haskell, yielding a domain specific sublanguage of Haskell that can be used for prototyping of implementations. In this paper we present a generic C++ library that implements a domain-specific language for vulnerability assessment, based on the formal Haskell description. The library rests upon and implements only a few notions, most importantly, that of a monadic system, a crucial part in the vulnerability assessment formalisation. We describe the Haskell description of monadic systems and we show our mapping of the description to generic C++ components. Our library heavily relies on concepts, a C++ feature supporting generic programming: a conceptual framework forms the domain-specific type system of our library and parametrised types and functions, ``typed'' by the concepts in our conceptual framework, represent the combinators and algorithms of the domain. Furthermore, we discuss what makes our library a domain specific language and how our domain-specific library scheme can be used for other domains (concerning language design, software design, and implementation techniques).

Author

Daniel Lincke

Potsdam Institute for Climate Impact Research

Patrik Jansson

Chalmers, Computer Science and Engineering (Chalmers), Software Engineering and Technology (Chalmers)

Marcin Zalewski

Chalmers, Computer Science and Engineering (Chalmers), Software Engineering and Technology (Chalmers)

Cezar Ionescu

Potsdam Institute for Climate Impact Research

Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)

03029743 (ISSN) 16113349 (eISSN)

Vol. 5658/2009 236-261

Areas of Advance

Information and Communication Technology

Driving Forces

Sustainable development

Roots

Basic sciences

Subject Categories

Other Environmental Engineering

Software Engineering

Climate Research

Computer Science

DOI

10.1007/978-3-642-03034-5_12

ISBN

978-3-642-03033-8

More information

Latest update

2/23/2018