APL—compilation-where does the time come from?

Graham C. Driscoll, Donald L. Orth · ACM SIGAPL APL Quote Quad · 1987

We have developed an experimental system to compile APL by translating it into a high-level language that has a compiler. The compiled functions can be called by the IBM APL2 interpreter through its name-association interface. Five of the ways in which use of our system saves execution time are discussed here. For scalar APL code, some savings result from the removal of all parsing and much checking for conformability and case at run time. Substantial savings sometimes arise from the feasibility of searching for a wider variety of special cases. Where they apply, such complications as non-zero comparison tolerances are costly; we avoid these costs and expect the programmer to take care of these complications explicitly at the relatively few points where they are needed. By combining loops where possible, we sometimes achieve significant savings. Finally, we conjecture that the greatest savings are most often due to our general method of combining primitive APL operations; we can often eliminate redundant computation and avoid storing and fetching temporary results. Examples are given.

Read the paper · More papers on PaperTik