LibDSL: a library for developing embedded domain specific languages in d via template metaprogramming
-
Published:2015-05-12
Issue:3
Volume:50
Page:63-72
-
ISSN:0362-1340
-
Container-title:ACM SIGPLAN Notices
-
language:en
-
Short-container-title:SIGPLAN Not.
Author:
Shioda Masato1,
Iwasaki Hideya1,
Sato Shigeyuki1
Affiliation:
1. University of Electro-Communications, Japan
Abstract
This paper presents a library called LibDSL that helps the implementer of an embedded domain specific language (EDSL) effectively develop it in D language. The LibDSL library accepts as input some kinds of ``specifications'' of the EDSL that the implementer is going to develop and a D program within which an EDSL source program written by the user is embedded. It produces the front-end code of an LALR parser for the EDSL program and back-end code of the execution engine. LibDSL is able to produce two kinds of execution engines, namely compiler-based and interpreter-based engines, either of which the user can properly choose depending on whether an EDSL program is known at compile time or not. We have implemented the LibDSL system by using template metaprogramming and other advanced facilities such as compile-time function execution of D language. EDSL programs developed by means of LibDSL have a nice integrativeness with the host language.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software