Optimising embedded DSLs using Template Haskell

Sean Seefried, Manuel Chakravarty, Gabriele Keller

Research output: Contribution to journalArticleAcademicpeer-review

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.

Original languageEnglish
Pages (from-to)186-205
Number of pages20
JournalLecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
Volume3286
Publication statusPublished - 1 Dec 2004
Externally publishedYes

Fingerprint

Dive into the research topics of 'Optimising embedded DSLs using Template Haskell'. Together they form a unique fingerprint.

Cite this