USING CAPABILITIES OF RACKET TO IMPLEMENT A DOMAIN-SPECIFIC LANGUAGE

  • Иван Андреевич Долгаков Институт прикладной астрономии РАН, наб. Кутузова, 10, 191187, г. Санкт-Петербург, Россия
  • Дмитрий Алексеевич Павлов Институт прикладной астрономии РАН, наб. Кутузова, 10, 191187, Санкт-Петербург, Россия
Ключевые слова: 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.

Биографии авторов

Иван Андреевич Долгаков, Институт прикладной астрономии РАН, наб. Кутузова, 10, 191187, г. Санкт-Петербург, Россия

research engineer at the Laboratory of Ehemeris Astronomy, Institute of Applied Astronomy RAS, ia.dolgakov@iaaras.ru

Дмитрий Алексеевич Павлов, Институт прикладной астрономии РАН, наб. Кутузова, 10, 191187, Санкт-Петербург, Россия

PhD, senior researcher at the Laboratory of Ehemeris Astronomy, Institute of Applied Astronomy RAS, dpavlov@iaaras.ru

Литература

M. Tadjouddine, S. A. Forth, and J. D. Pryce, “AD tools and prospects for optimal AD in CFD flux Jacobian calculations,” Automatic differentiation of algorithms, NY: Springer, pp. 255–261, 2002. doi: 10.1007/978-1-4613-0075-5_30

C. Bischof, A. Carle, G. Corliss, A. Griewank, and P. Hovland, “ADIFOR–generating derivative codes from Fortran programs,” Scientific Programming, vol. 1, no. 1, pp. 11-–29, 1992; doi: 10.4236/ojas.2013.34040

C. H. Bischof, L. Roh, and A. J. Mauer-Oats, “ADIC: an extensible automatic differentiation tool for ANSI-C,” Software: Practice and Experience, vol. 27, no. 12, pp. 1427—1456, 1997.

A. Griewank, D. Juedes, and J. Utke, “Algorithm 755: ADOL-C: a package for the automatic differentiation of algorithms written in C/C++,” ACM Transactions on Mathematical Software (TOMS), vol. 22, no. 2, pp. 131–167, 1996.

I. Dolgakov and D. Pavlov, “Landau: language for dynamical systems with automatic differentiation,” preprint arXiv:1905.10206, 2019.

M. Felleisen, R. B. Findler, M. Flatt, S. Krishnamurthi, E. Barzilay, J. McCarthy, and S.Tobin-Hochstadt, “A programmable programming language,” Communications of the ACM, vol. 61, no 3, pp. 62–71, 2018; doi: 10.1145/3127323

D. A. Pavlov, “Developing a programming language in Racket,” Computer tools in Education, no. 5, pp. 46–63, 2012 (in Russian).

D. A. Pavlov, “Creating domain-specific languages,” Computer Tools in Education, no. 6, pp. 57–60, 2011 (in Russian).

Опубликован
2019-12-28
Выпуск
Раздел
Computer science