Using capabilities of Racket to implement a domain-specific language
Computer Assisted Mathematics, 1, 20–31 (2019)
Ключевые слова: Automatic differentiation, dynamical systems, compilers, domain-specific languages, RacketИнформация о статье Текст статьи
An implementation of a domain-specific language, Landau, based on the Racket platform, is presented. Landau is a dynamical system specification language, used in an environment where parameters of the dynamical system must be determined from processing of observational data. That, in turn, requires efficient and accurate calculation of derivatives, which can be achieved with the automatic differentiation (AD) technique. Landau is a Turing incomplete statically typed language aimed to support code generation with AD. The Turing incompleteness provides the ability of analyzing the whole program workflow to figure out the chain of derivatives’ calculation. Landau has compile-time ranged for loops, if/else branching constructions, mutable variables and arrays. Landau can be compiled to both Racket and ANSI C. Landau implementation takes advantage of features that are unique to the Racket platform and make creation of DSLs more convenient than on other platform.