Translets – a lightweight parser combinator library

Markus Lepper, semantics GmbH
Baltasar Trancón y Widemann, Technische Universität Ilmenau

Translets is a light-weight embedded domain specific language for implementing (the front-ends of) light-weight embedded domain specific languages. In many situations small parsers are required for the processing of readable and convenient denotations of values from complex, domain-specific data types. Translets is a parser combinator library for this purpose.

The project aims at enabling domain experts, who are neither computing scientists nor language experts, to design small, ad-hoc languages for their realm. This is supported by these design criteria:

  1. Both sides, the syntax of the input and the data type of the generated parser's output, are defined together and in strict correspondence, thus explaining each other;
  2. parsing is executed non-deterministically and most technical details are hidden from the user;
  3. extensive error messages are generated in case of parsing failure;
  4. the resulting data is immediately accessible after parsing, without further transformation steps or analysis.

Translets have been successfully employed in widely varying contexts, from graphic animation scripts to conventional music notation.