What makes a good domain-specific language? APOSTLE, and its approach to parallel discrete event simulation

David Bruce. What makes a good domain-specific language? APOSTLE, and its approach to parallel discrete event simulation. , 1997. [doi]

Abstract

General-purpose programming languages are a Good Thing, but domain-specific languages can be better. Such languages provide a natural vocabulary for concepts that are fundamental to the problem domain, whilst with general-purpose languages one is reduced to idiom: idiom, moreover, that is of its very nature alien to the host language - not to mention uncheckable. In addition, domain knowledge often inspires a range of optimizations that would not otherwise suggest themselves, let alone be practical. Domain-specific languages necessarily differ from general-purpose languages in their purpose, and therefore design, but we claim that the underlying principles can and should be the same. There need be no contradiction here: one is merely enriching the conceptual basis upon which the language is grown. The principled introduction of new concepts may have profound - and sometimes unanticipated! - consequences, however, so language designers (and implementors) must be prepared to follow these to their natural conclusion.We illustrate these ideas more concretely by reference to apostle, a language for (parallel) discrete event simulation. Here the new concepts are time and concurrency, but apostle’s real power comes from the orthogonality of their introduction. The use of these and other features are easily checked in a precise yet general manner by means of an ‘effect’ system, which also serves to determine the applicability of optimizations, both general-purpose and domain-specific.