Optimising Embedded DSLs Using Template Haskell

  • Sean Seefried
  • Manuel Chakravarty
  • Gabriele Keller
Conference paper

DOI: 10.1007/978-3-540-30175-2_10

Part of the Lecture Notes in Computer Science book series (LNCS, volume 3286)
Cite this paper as:
Seefried S., Chakravarty M., Keller G. (2004) Optimising Embedded DSLs Using Template Haskell. In: Karsai G., Visser E. (eds) Generative Programming and Component Engineering. GPCE 2004. Lecture Notes in Computer Science, vol 3286. Springer, Berlin, Heidelberg

Abstract

Embedded domain specific languages (EDSLs) provide a specialised language for a particular application area while harnessing the infrastructure of an existing general purpose programming language. The reduction in implementation costs that results from this approach comes at a price: the EDSL often compiles to inefficient code since the host language’s compiler only optimises at the level of host language constructs. The paper presents an approach to solving this problem based on compile-time meta-programming which retains the simplicity of the embedded approach. We use PanTHeon, our implementation of an existing EDSL for image synthesis to demonstrate the benefits and drawbacks of this approach. Furthermore, we suggest potential improvements to Template Haskell, the meta-programming framework we are using, which would greatly improve its applicability to this kind of task.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2004

Authors and Affiliations

  • Sean Seefried
    • 1
  • Manuel Chakravarty
    • 1
  • Gabriele Keller
    • 1
  1. 1.PLC Research GroupThe University of New South Wales, Sydney, National ICT Australia, ERTOS 

Personalised recommendations