Compiling a subset of APL into a typed intermediate language

Martin Elsman, Martin Dybdal

6 Citations (Scopus)

Abstract

We present a compiler and a typed intermediate language for a subset of APL. The intermediate language treats all numeric data as multi-dimensional arrays and the type system makes explicit the ranks of arrays. Primitive operators are polymorphic in rank and in the type of the underlying data operated on. The frontend of the APL compiler deals with much of the gory details of the APL language, including infix resolution, resolution of identity items for reduce operations, resolution of default element values for empty arrays, scalar extensions, and resolution of certain kinds of overloading. We demonstrate the usefulness of the intermediate language by showing that it can be compiled efficiently, using known techniques, such as delayed arrays, into a C-like language. We also demonstrate that the language is sufficiently expressive that some primitive operators, such as APL's inner product operator, which works on arrays of arbitrary dimensions, can be compiled using more primitive operators..

Original languageEnglish
Title of host publicationProceedings of ACM SIGPLAN International Workshop on Libraries, Languages and Compilers for Array Programming (ARRAY’14) : ARRAY'14
Number of pages6
PublisherAssociation for Computing Machinery
Publication date9 Jun 2014
Pages101-106
ISBN (Print)978-1-4503-2937-8
DOIs
Publication statusPublished - 9 Jun 2014
EventACM SIGPLAN International Workshop on Libraries, Languages and Compilers for Array Programming 2014 - Edinburgh, United Kingdom
Duration: 12 Jun 201413 Jun 2014

Conference

ConferenceACM SIGPLAN International Workshop on Libraries, Languages and Compilers for Array Programming 2014
Country/TerritoryUnited Kingdom
CityEdinburgh
Period12/06/201413/06/2014

Cite this