The Design and Implementation of the Wolfram Language Compiler Abdul Dakkak Tom Wickham-Jones Wen-mei Hwu University of Illinois, Wolfram Research University of Illinois, Urbana-Champaign Oxford, UK Urbana-Champaign Champaign, Illinois, USA
[email protected] Champaign, Illinois, USA
[email protected] [email protected] Abstract The popularity of data- and scientific-oriented applications, abundance of on-demand compute resources, and scarcity of domain expert programmers have given rise to high-level scripting languages. These high-level scripting languages offer a fast way to translate ideas into code, but tend toincur a heavy performance overhead. In order to alleviate the per- formance penalty, each implementation of these languages often offers a compilation path to a subset of the language. In this paper we present the design and implementation of the Wolfram Language compiler, the production compiler for the Wolfram Language. We show how popular language fea- tures and runtime behavior, expected by Wolfram Language developers, are efficiently implemented within the compiler. We then show how the compiler provides a friction-less path to migrate programs from the interpreter to the compiler. We evaluate the compiler and show that compiled code matches the performance of highly tuned hand-written C code. The compiler has been released as a prominent feature of Wol- fram Engine v12 and is readily available to developers. CCS Concepts. · Software and its engineering Compil- Figure 1. A typical Wolfram Notebook session. Users in- ers; Software performance;• Mathematics of com- termix documentation with code to develop computation puting Mathematical software. Notebooks. The Notebook is interactively evaluated.