Central European Functional Programming School

Volume 7241 of the series Lecture Notes in Computer Science pp 402-439

Feldspar: Application and Implementation

  • Emil AxelssonAffiliated withCSE Dept., Chalmers University of Technology
  • , Mary SheeranAffiliated withCSE Dept., Chalmers University of Technology

* Final gross prices may vary according to local VAT.

Get Access


The Feldspar project aims to develop a domain specific language for Digital Signal Processing algorithm design. From functional descriptions, imperative code (currently C) is generated. The project partners are Ericsson, Chalmers and ELTE, Budapest. The background and motivation for the project have been documented elsewhere [3]. We aim to raise the level of abstraction at which algorithm developers and implementors work, and to generate, from Feldspar descriptions, the kind of code that is currently written by hand.

These lecture notes first give a brief introduction to Feldspar and the style of programming that it encourages. Next, we document the implementation of Feldspar as a domain specific language (DSL), embedded in Haskell. The implementation is built using a library called Syntactic that was built for this purpose, but also designed to be of use to other implementors of embedded domain specific languages. We show the implementation of Feldspar in sufficient detail to give the reader an understanding of how the use of the Syntactic library enables the modular construction of an embedded DSL. For those readers who would like to apply these techniques to their own DSL embedded in Haskell, further instructions are given in section 5.

The programming examples are available in the CEFP directory of the Feldspar package, version

The code can be fetched by running:

> cabal unpack feldspar-language-

All code is written in Haskell, and has been tested using the Glasgow Haskell Compiler (GHC), version 7.0.2, and the packages

  • syntactic-0.8

  • feldspar-language-

  • feldspar-compiler-