Content area
Full text
Abstract - The use of domain-specific languages (DSLs) can improve the productivity of software development. However, the complexity of DSL development prevents more wide-spread usage of this technique. In this paper a framework of language construction is proposed that aims to support reusability of language elements and tools and therefore lower the cost of DSL development. It is based on the generic language that provides a syntactic substrate for developed languages. Language elements are evaluated using special functions that are expressed in existing general-purpose language. A system for static checking of code is also included. The paper presents example languages implemented using the prototype of proposed system.
Keywords: Domain-specific language; generic syntax; metaprogramming; reusability.
I. INTRODUCTION
Development of software systems requires to define solutions to problems from different domains. In most cases it is more natural to describe these solutions using concepts and operations from the domain. This leads to introduction of new concepts into the programming language using mechanisms that the language provides, for example classes or functions. However a generalpurpose language may not allow to express operations of the domain naturally. In this case a domain-specific language (DSL) can be introduced, that is specially designed for solving problems in the domain [1], [2].
A domain-specific language can be developed as a completely new language (external DSL) or it may be based on the syntax of general-purpose language used for development of the rest of the system (internal DSL) [2]. While technically being a subset of the host language, internal DSL uses its syntactic elements in some special way, that breaks common conventions of the host language. This allows it to appear as a separate language from the perspective of language user.
Development of a new external language may be complex, involving development of parser, compiler or interpreter, editor, and other tools. Although some of the tasks can be automated using existing tools like parser generators Yacc [3] or Antlr [4], it still requires to define a lot of language artifacts. On the other hand, internal DSLs are constrained by the host language.
II. DSL CONSTRUCTION ON GENERIC LANGUAGE
In the middle of these approaches is the use of some existing generic language as a basis of a DSL. We would use the...





