Document Open Access Logo

Finally, a Polymorphic Linear Algebra Language (Pearl)

Authors Amir Shaikhha, Lionel Parreaux

Thumbnail PDF


  • Filesize: 498 kB
  • 29 pages

Document Identifiers

Author Details

Amir Shaikhha
  • Department of Computer Science, University of Oxford, UK
Lionel Parreaux
  • DATA Lab, EPFL, Lausanne, Switzerland


The authors would like to thank Jeremy Gibbons and Oleg Kiselyov for their helpful comments on draft versions of this paper. The first author was partially supported by EPFL during the preparation of this paper.

Cite AsGet BibTex

Amir Shaikhha and Lionel Parreaux. Finally, a Polymorphic Linear Algebra Language (Pearl). In 33rd European Conference on Object-Oriented Programming (ECOOP 2019). Leibniz International Proceedings in Informatics (LIPIcs), Volume 134, pp. 25:1-25:29, Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2019)


Many different data analytics tasks boil down to linear algebra primitives. In practice, for each different type of workload, data scientists use a particular specialised library. In this paper, we present Pilatus, a polymorphic iterative linear algebra language, applicable to various types of data analytics workloads. The design of this domain-specific language (DSL) is inspired by both mathematics and programming languages: its basic constructs are borrowed from abstract algebra, whereas the key technology behind its polymorphic design uses the tagless final approach (a.k.a. polymorphic embedding/object algebras). This design enables us to change the behaviour of arithmetic operations to express matrix algebra, graph algorithms, logical probabilistic programs, and differentiable programs. Crucially, the polymorphic design of Pilatus allows us to use multi-stage programming and rewrite-based optimisation to recover the performance of specialised code, supporting fixed sized matrices, algebraic optimisations, and fusion.

Subject Classification

ACM Subject Classification
  • Software and its engineering → Domain specific languages
  • Computing methodologies → Linear algebra algorithms
  • Mathematics of computing → Automatic differentiation
  • Mathematics of computing → Graph algorithms
  • Theory of computation → Probabilistic computation
  • Linear Algebra
  • Domain-Specific Languages
  • Tagless Final
  • Polymorphic Embedding
  • Object Algebra
  • Multi-Stage Programming
  • Graph Processing
  • Probabilistic Programming
  • Automatic Differentiation


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads
Questions / Remarks / Feedback

Feedback for Dagstuhl Publishing

Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail