Abstract
Strongly-typed functional languages provide a powerful framework for embedding Domain-Specific Languages (DSLs). However, building type-safe functions defined over an embedded DSL can introduce application-specific type constraints that end up being imposed on the DSL data types themselves. At best, these constraints are unwieldy and at worst they can limit the range of DSL expressions that can be built. We present a simple solution to this problem that allows application-specific constraints to be specified at the point of use of a DSL expression rather than when the DSL's embedding types are defined. Our solution applies equally to both tagged and tagless representations and, importantly, also works in the presence of higher-rank types.
- L. Augustsson, H. Mansell, and G. Sittampalam. Paradise: A Two-Stage DSL Embedded in Haskell. In phProceedings of the 13th ACM SIGPLAN International Conference on Functional Programming, ICFP '08, pages 225--228, New York, NY, USA, 2008. ACM. ISBN 978--1--59593--919--7. Google Scholar
Digital Library
- E. Axelsson, K. Claessen, M. Sheeran, J. Svenningsson, D. Engdal, and A. Persson. The Design and Implementation of Feldspar - An Embedded Language for Digital Signal Processing. In phProceedings of the 22nd Symposium on Implementation and Application of Functional Languages, Lecture Notes in Computer Science, pages 121--136. Springer-Verlag, 2010. ISBN 978--3--642--24275--5. Google Scholar
Digital Library
- E. C. Brady. IDRIS -- Systems Programming Meets Full Dependent Types. In phProceedings of the 5th ACM Workshop on Programming Languages Meets Program Verification, PLPV '11, pages 43--54, New York, NY, USA, 2011. ACM. ISBN 978--1--4503-0487-0. Google Scholar
Digital Library
- E. C. Brady and K. Hammond. Scrapping your Inefficient Engine: Using Partial Evaluation to Improve Domain-Specific Language Implementation. phACM SIGPLAN Notices, 45 (9): 297--308, September 2010. ISSN 0362--1340. Google Scholar
Digital Library
- J. Carette, O. Kiselyov, and C. chieh Shan. Finally Tagless, Partially Evaluated: Tagless Staged Interpreters for Simpler Typed Languages. phJournal of Functional Programming, 19: 509--543, September 2009. ISSN 0956--7968. Google Scholar
Digital Library
- and Marlow}Chakravarty05AssociatedM. M. T. Chakravarty, G. Keller, S. Peyton Jones, and S. Marlow. Associated Types with Class. In phProceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL '05, pages 1--13, New York, NY, USA, 2005. ACM. ISBN 1--58113--830-X. Google Scholar
Digital Library
- M. M. T. Chakravarty, G. Keller, S. Lee, T. L. McDonell, and V. Grover. Accelerating Haskell Array Codes with Multicore GPUs. In phProceedings of the 6th Workshop on Declarative Aspects of Multicore Programming, DAMP '11, pages 3--14, New York, NY, USA, 2011. ACM. ISBN 978--1--4503-0486--3. Google Scholar
Digital Library
- C. Elliott, S. Finne, and O. de Moor. Compiling Embedded Languages. phJournal of Functional Programming, 13 (3): 455--481, 2003. ISSN 0956--7968. Google Scholar
Digital Library
- K. Hammond, J. Berthold, and R. Loogen. Automatic Skeletons in Template Haskell. phParallel Processing Letters, 13 (3): 413--424, September 2003. ISSN 0129--6264.Google Scholar
Cross Ref
- C. Hofer, K. Ostermann, T. Rendel, and A. Moors. Polymorphic Embedding of DSLs. In phProceedings of the 7th International Conference on Generative Programming and Component Engineering, GPCE '08, pages 137--148, New York, NY, USA, 2008. ACM. ISBN 978--1--60558--267--2. Google Scholar
Digital Library
- J. Hughes. Restricted Data Types in Haskell. In phProceedings of the 1999 Haskell Workshop. University of Utrecht, Technical Report UU-CS-1999--28, October 1999.Google Scholar
- O. Kiselyov and C. chieh Shan. Functional Pearl: Implicit Configurations--or, Type Classes Reflect the Values of Types. In phProceedings of the 2004 ACM SIGPLAN Workshop on Haskell, Haskell '04, pages 33--44, New York, NY, USA, 2004. ACM. ISBN 1--58113--850--4. Google Scholar
Digital Library
- el, and Schupke}Kiselyov04HListO. Kiselyov, R. L\"ammel, and K. Schupke. Strongly Typed Heterogeneous Collections. In phProceedings of the 2004 ACM SIGPLAN Workshop on Haskell, Haskell '04, pages 96--107, New York, NY, USA, 2004. ACM. ISBN 1--58113--850--4. Google Scholar
Digital Library
- D. Leijen and E. Meijer. Domain-Specific Embedded Compilers. In phProceedings of the 2nd Conference on Domain-Specific Languages - Volume 2, DSL'99, pages 109--122, Berkeley, CA, USA, 1999. USENIX Association. Google Scholar
Digital Library
- G. Mainland and G. Morrisett. Nikola: Embedding Compiled GPU Functions in Haskell. In phProceedings of the 3rd ACM Haskell Symposium, Haskell '10, pages 67--78, New York, NY, USA, 2010. ACM. ISBN 978--1--4503-0252--4. Google Scholar
Digital Library
- C. McBride. Faking It: Simulating Dependent Types in Haskell. phJournal of Functional Programming, 12: 375--392, July 2002. ISSN 0956--7968. Google Scholar
Digital Library
- U. Norell. phTowards a Practical Programming Language based on Dependent Type Theory. PhD thesis, Department of Computer Science and Engineering, Chalmers University of Technology, SE-412 96 Göteborg, Sweden, September 2007.Google Scholar
- M. Odersky, P. Altherr, V. Cremet, B. Emir, S. Maneth, S. Micheloud, N. Mihaylov, M. Schinz, E. Stenman, and M. Zenger. An Overview of the Scala Programming Language. Technical Report IC/2004/64, EPFL Lausanne, Switzerland, 2004.Google Scholar
- D. A. Orchard and T. Schrijvers. Haskell Type Constraints Unleashed. In phProceedings of the 10th International Symposium on Functional and Logic Programming, Lecture Notes in Computer Science, pages 56--71. Springer-Verlag, 2010. ISBN 978--3--642--12251--4. Google Scholar
Digital Library
- N. Oury and W. Swierstra. The Power of Pi. In phProceedings of the 13th ACM SIGPLAN International Conference on Functional Programming, ICFP '08, pages 39--50, New York, NY, USA, 2008. ACM. ISBN 978--1--59593--919--7. Google Scholar
Digital Library
- E. Pavsalić, W. Taha, and T. Sheard. Tagless Staged Interpreters for Typed Languages. In phProceedings of the 7th ACM SIGPLAN International Conference on Functional Programming, ICFP '02, pages 218--229, New York, NY, USA, 2002. ACM. ISBN 1--58113--487--8. Google Scholar
Digital Library
- t al.(1997)Peyton Jones, Jones, and Meijer}Jones97TypeClassDesignS. Peyton Jones, M. Jones, and E. Meijer. Type Classes: Exploring the Design Space. In phProceedings of the 1997 Haskell Workshop, 1997.Google Scholar
- t al.(2007)Peyton Jones, Vytiniotis, Weirich, and Shields}Jones07PracticalS. Peyton Jones, D. Vytiniotis, S. Weirich, and M. Shields. Practical Type Inference for Arbitrary-Rank Types. phJournal of Functional Programming, 17: 1--82, January 2007. ISSN 0956--7968. Google Scholar
Digital Library
- Sulzmann, and Vytiniotis}Schrijvers09CompleteGADTsT. Schrijvers, S. Peyton Jones, M. Sulzmann, and D. Vytiniotis. Complete and Decidable Type Inference for GADTs. In phProceedings of the 14th ACM SIGPLAN International Conference on Functional Programming, ICFP '09, pages 341--352, New York, NY, USA, 2009. ACM. ISBN 978--1--60558--332--7. Google Scholar
Digital Library
- S. Seefried, M. M. T. Chakravarty, and G. Keller. Optimising Embedded DSLs Using Template Haskell. In phGPCE '04, volume 3286 of phLecture Notes in Computer Science, pages 186--205. Springer-Verlag, 2004. ISBN 3--540--23580--9.Google Scholar
- 002)}Sheard02TemplateT. Sheard and S. Peyton Jones. Template Meta-Programming for Haskell. phSIGPLAN Notices, 37: 60--75, December 2002. ISSN 0362--1340. Google Scholar
Digital Library
- Vytiniotis06BoxyD. Vytiniotis, S. Weirich, and S. Peyton Jones. Boxy Types: Inference for Higher-Rank Types and Impredicativity. In phProceedings of the 11th ACM SIGPLAN International Conference on Functional Programming, ICFP '06, pages 251--262, New York, NY, USA, 2006. ACM. ISBN 1--59593--309--3. Google Scholar
Digital Library
- P. Wadler and S. Blott. How to Make Ad-Hoc Polymorphism Less Ad Hoc. In phProceedings of the 16th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL '89, pages 60--76, New York, NY, USA, 1989. ACM. ISBN 0--89791--294--2. Google Scholar
Digital Library
- Vytiniotis, and aes}Yorgey12PromotionB. A. Yorgey, S. Weirich, J. Cretin, S. Peyton Jones, D. Vytiniotis, and J. P. M. aes. Giving Haskell a Promotion. In phProceedings of the 8th ACM SIGPLAN Workshop on Types in Language Design and Implementation, TLDI '12, pages 53--66, New York, NY, USA, 2012. ACM. ISBN 978--1--4503--1120--5. Google Scholar
Digital Library
Index Terms
Deconstraining DSLs
Recommendations
Deconstraining DSLs
ICFP '12: Proceedings of the 17th ACM SIGPLAN international conference on Functional programmingStrongly-typed functional languages provide a powerful framework for embedding Domain-Specific Languages (DSLs). However, building type-safe functions defined over an embedded DSL can introduce application-specific type constraints that end up being ...
Polymorphic embedding of dsls
GPCE '08: Proceedings of the 7th international conference on Generative programming and component engineeringThe influential pure embedding methodology of embedding domain-specific languages (DSLs) as libraries into a general-purpose host language forces the DSL designer to commit to a single semantics. This precludes the subsequent addition of compilation, ...
Reusing legacy DSLs with Melange
DSM 2015: Proceedings of the Workshop on Domain-Specific ModelingThe proliferation of independently-developed and constantly-evolving domain-specific languages (DSLs) in many domains raises new challenges for the software language engineering community. Instead of starting the definition of new DSLs from scratch, ...







Comments