Domain specific languages (DSLs) and tools

Domain specific languages (DSLs) provide means for programming with first-class domain-specific concepts and programming models—typically at the cost of not providing the computational power of GPLs. This way, DSL-based programs are, typically, much more declarative than programs written in a general purpose language, focusing more on the “what” of a problem to be solved rather than on the exact “how” in form of a specific algorithm. Examples of DSLs in widespread use are the Structured Query Language (SQL), HTML 5, or Modelica, a language for object-oriented physical modelling.

Domain specific languages generally offer two major key benefits. First, domain experts can program in an adequate DSL without actually being trained in general programming and computer architecture. Hence, they lower the entrance barrier to programming for people not educated in computer science or a related subject. Second, from the restriction to a particular domain, highly specialized and efficient software tooling can be provided. For instance, compilers can automatically perform performance optimizations on DSL-based code which are not possible in GPLs: since additional information on the problem domain is available, search spaces may be pruned, and the knowledge of possible operations, their interaction with each other and their impact on data structures enables corresponding optimizations.

At the chair for compiler construction we aim at leveraging the additional domain-specific information provided by DSLs for new domain-specific optimizations. We further want to make DSL programming a more sophisticated experience for domain experts to enable them to get the best from their code at the least possible effort. Together with our project partners, we do DSL-related research in multiple domains from the areas of embedded computing as well as cloud and scientific computing. Some of these projects are discussed below.

Parallel Particle Mesh Environment

The "Parallel Particle Mesh Environment (PPME)" is a domain-specific language and development environment for implementing scientific simulations based on particle and mesh methods. It generates Fortran code that links with the PPM library, which is developed by the MOSAIC group. PPM already includes a preprocessor-based language to ease writing clients to the library. However, this language does not provide any syntactic checking, optimisations, editing or debugging capabilities.

Thus, to address these problems, the main objectives of PPME are
•    providing a high-level and simple to use fronted for PPM client applications
•    avoiding the need for explicit parallelisation code
•    providing editing capabilities that guide the development, e.g., by checking constraints
•    using domain-specific knowledge to do advanced optimisations, e.g., to reduce the simulation time or to increase precision
•    providing sufficient extensibility to support different target languages and new features

An open source prototype of PPME is hosted at BitBucket. It uses JetBrain's "Meta Programming System (MPS)" as an implementation platform. Using MPS, we can support a very high level of specification and abstraction which comes close to a natural mathematical notation. Current IDE features include static type checking and name resolution, automatic code generation, support of physical units and automatic precision analysis of equations. The screenshot below gives a first impression on the features of PPME; it shows the implementation of a Gray-Scott reaction-diffusion system.

References

 

Go back