Skip to main content

Feldspar: Application and Implementation

  • Chapter
Central European Functional Programming School (CEFP 2011)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 7241))

Included in the following conference series:

Abstract

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 0.5.0.1:

http://hackage.haskell.org/package/feldspar-language-0.5.0.1

The code can be fetched by running:

> cabal unpack feldspar-language-0.5.0.1

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-0.5.0.1

  • feldspar-compiler-0.5.0.1

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Syntactic library, version 0.8, http://hackage.haskell.org/package/syntactic-0.8

  2. Axelsson, E., Claessen, K., Sheeran, M., Svenningsson, J., Engdal, D., Persson, A.: The Design and Implementation of Feldspar- An Embedded Language for Digital Signal Processing. In: Hage, J., Morazán, M.T. (eds.) IFL 2010. LNCS, vol. 6647, pp. 121–136. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  3. Axelsson, E., Claessen, K., Dévai, G., Horváth, Z., Keijzer, K., Lyckegård, B., Persson, A., Sheeran, M., Svenningsson, J., Vajda, A.: Feldspar: A Domain Specific Language for Digital Signal Processing algorithms. In: 8th ACM/IEEE International Conference on Formal Methods and Models for Codesign (MEMOCODE 2010), pp. 169–178. IEEE Computer Society (2010)

    Google Scholar 

  4. Batcher, K.E.: Sorting networks and their applications. In: AFIPS Spring Joint Computing Conference, pp. 307–314 (1968)

    Google Scholar 

  5. Bjesse, P., Claessen, K., Sheeran, M., Singh, S.: Lava: Hardware Design in Haskell. In: ICFP 1998: Proceedings of the Third ACM SIGPLAN International Conference on Functional Programming, pp. 174–184. ACM (1998)

    Google Scholar 

  6. Carette, J., Kiselyov, O., Shan, C.: Finally tagless, partially evaluated: Tagless staged interpreters for simpler typed languages. Journal of Functional Programming 19(05), 509–543 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  7. Claessen, K., Sheeran, M., Svensson, B.J.: Expressive array constructs in an embedded GPU kernel programming language. In: Proceedings of the 7th Workshop on Declarative Aspects and Applications of Multicore Programming, DAMP 2012, pp. 21–30. ACM (2012)

    Google Scholar 

  8. Cooley, J.W., Tukey, J.W.: An algorithm for the machine calculation of complex Fourier series. Math. Comp. 19, 297–301 (1965)

    Article  MathSciNet  MATH  Google Scholar 

  9. Dévai, G., Tejfel, M., Gera, Z., Páli, G., Nagy, G., Horváth, Z., Axelsson, E., Sheeran, M., Vajda, A., Lyckegård, B., Persson, A.: Efficient code generation from the high-level domain-specific language Feldspar for DSPs. In: ODES-8: 8th Workshop on Optimizations for DSP and Embedded Systems (2010)

    Google Scholar 

  10. Duhamel, P., Vetterli, M.: Fourier Transforms: A Tutorial Review and a State of the Art. In: Madisetti, V.K., Williams, D.B. (eds.) Digital Signal Processing Handbook. CRC Press LLC (1999)

    Google Scholar 

  11. Elliott, C., Finne, S., de Moor, O.: Compiling embedded languages. Journal of Functional Programming 13(3), 455–481 (2003)

    Article  MATH  Google Scholar 

  12. Gill, A.: Type-safe observable sharing in Haskell. In: Haskell 2009: Proceedings of the 2nd ACM SIGPLAN Symposium on Haskell, pp. 117–128. ACM (2009)

    Google Scholar 

  13. Hudak, P.: Modular domain specific languages and tools. In: ICSR 1998: Proceedings of the 5th International Conference on Software Reuse, pp. 134–142. IEEE Computer Society Press (1998)

    Google Scholar 

  14. Keller, G., Chakravarty, M.M.T., Leshchinskiy, R., Peyton Jones, S., Lippmeier, B.: Regular, shape-polymorphic, parallel arrays in Haskell. In: Proceedings of the 15th ACM SIGPLAN International Conference on Functional Programming, ICFP 2010, pp. 261–272. ACM (2010)

    Google Scholar 

  15. Persson, A., Axelsson, E., Svenningsson, J.: Generic Monadic Constructs for Embedded Languages. In: IFL 2011: 23rd International Symposium on Implementation and Application of Functional Languages. LNCS, vol. 7257. Springer, Heidelberg (2012)

    Google Scholar 

  16. Schrijvers, T., Peyton Jones, S., Sulzmann, M., Vytiniotis, D.: Complete and decidable type inference for GADTs. In: Proc. 14th ACM SIGPLAN International Conference on Functional Programming, pp. 341–352. ACM (2009)

    Google Scholar 

  17. Swierstra, W.: Data types à la carte. Journal of Functional Programming 18(04), 423–436 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  18. Wadler, P.: The expression problem (1998), http://www.daimi.au.dk/~madst/tool/papers/expression.txt

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Axelsson, E., Sheeran, M. (2012). Feldspar: Application and Implementation. In: Zsók, V., Horváth, Z., Plasmeijer, R. (eds) Central European Functional Programming School. CEFP 2011. Lecture Notes in Computer Science, vol 7241. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-32096-5_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-32096-5_8

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-32095-8

  • Online ISBN: 978-3-642-32096-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics