Work on APL compilers has been going on for about 20 years. A number of papers have appeared in APL conference proceedings describing various techniques for compiling APL. An APL compiler may appear that removes all constraints imposed by the language, but none to my knowledge has yet achieved this goal. Because of its design as an interpreted, interactive system, APL presents many challenges to the compiler writer.
Most compilers developed to date, including the one described by this paper, have traded off language features to achieve various compilational goals. Here, the goal was to improve the execution speed of large, non-interactive economic models while retaining the rapid development capabilities provided by APL. The tradeoffs in this case were using a target program that was not interactive, was fully debugged before compilation, and avoided use of certain APL primitives, such as execution of arbitrary strings, that present difficulties in a compiled environment. That said, the authors are looking ahead to adding other APL features, such as nested arrays, to their compiled environment.
The “compiler,” as the authors readily admit, is really a translator that maps APL statements into C++. A library of C++ functions and data structures that parallels APL’s functions and data is used to facilitate the mapping. Compilation of the C++ code yields a machine-code version of the original program. An advantage of the use of a high-level intermediate language such as C++ is the availability of compilers for many hardware systems, which allows creation of portable code. One test case is described: 200 lines of APL translated to 900 lines of C++, and the compiled binary ran 3.5 times faster than the interpreted APL. A sample showing 12 lines of APL code and the corresponding C++ is included in the paper.
Similar projects have been reported, but this paper offers no references to show the authors’ awareness of other work in the area. The text is clear and understandable.