SEPLFeb 16, 2021

Compilation of mathematical expressions in Kotlin

arXiv:2102.07924v3
Originality Synthesis-oriented
AI Analysis

This work addresses the need for efficient mathematical expression evaluation in scientific software engineering, presenting an incremental improvement by combining DSL and JIT compilation techniques.

The paper tackles the problem of runtime interpretation of mathematical expressions in scientific software by introducing a middle-ground solution in the KMath library that uses Kotlin's object builder DSL to generate an AST, which is then JIT-compiled to JVM bytecode, achieving performance comparisons across multiple Kotlin platforms.

Interpreting mathematical expressions at runtime is a standard task in scientific software engineering. There are different approaches to this problem from creating an embedded domain-specific language (eDSL) with its own parser and interpreter specifically for that task, to using a full-fledged embedded compiler. This article is dedicated to a middle-ground solution implemented in the KMath library, which uses the Kotlin object builder DSL and its own algebraic abstractions to generate an AST for mathematical operations. This AST is then compiled just-in-time to generate JVM bytecode. A similar approach is tested on other Kotlin platforms, where its performance is compared across a variety of supported platforms.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes