Safely Speaking in Tongues: Statically Checking Domain Specific Languages in Haskell
File(s)static-check-dsls-in-Haskell.pdf (161.46 KB)
Accepted version
Author(s)
Sackman, M
Eisenbach, S
Type
Conference Paper
Abstract
Haskell makes it very easy to build and use Domain Specific Languages (DSLs). However, it is frequently the case that a DSL has invariants that can not be easily enforced statically, resulting in runtime checks. This is a great pity given HaskellÆs rich and powerful type system and leads to all the usual problems of dynamic checking. \r\n\r\nWe believe that Domain Specific Languages are becoming more popular: the internet itself is a good example of many DSLs (HTML, CSS, JavaScript, Flash, etc), and more seem to be being added every day; most graphics cards already accept programs written in the DSL OpenGL Shading Language (GLSL); and the predicted growth of heterogeneous CPUs (for example IBMÆs Cell CPU) will demand many different DSLs for the various programming models and instruction sets that become available. \r\n\r\nWe present a technique that allows invariants of any given DSL to be lifted into the Haskell type system. This removes the need for runtime checks of the DSL and prevents programs that violate the invariants of the DSL from ever being compiled or executed. As a result we avoid the pitfalls of dynamic checking and return the user of the DSL to the safety and tranquillity of the strongly statically typed Haskell world. \r\n\r\n
Date Issued
2009-03
Citation
2009, pp.34-51
Source Title
Workshop on Language Descriptions Tools and Applications (LDTA) 2009
Start Page
34
End Page
51
Copyright Statement
© 2009 Elsevier. NOTICE: this is the author’s version of a work that was accepted for publication in (Journal unknown). Changes resulting from the publishing process, such as peer review, editing, corrections, structural formatting, and other quality control mechanisms may not be reflected in this document. Changes may have been made to this work since it was submitted for publication
Source
Workshop on Language Descriptions Tools and Applications (LDTA) 2009
Source Place
York, UK
Start Date
2009-03-27
Finish Date
2009-03-28
Coverage Spatial
York, UK