ACM Home Page
Please provide us with feedback. Feedback
Statically typed linear algebra in Haskell
Full text PdfPdf (144 KB)
Source Haskell archive
Proceedings of the 2006 ACM SIGPLAN workshop on Haskell table of contents
Portland, Oregon, USA
SESSION: Session 4 table of contents
Pages: 120 - 121  
Year of Publication: 2006
ISBN:1-59593-489-8
Author
Frederik Eaton  University College London
Sponsors
SIGPLAN: ACM Special Interest Group on Programming Languages
ACM: Association for Computing Machinery
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 5,   Downloads (12 Months): 39,   Citation Count: 0
Additional Information:

abstract   references   index terms  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1159842.1159859
What is a DOI?

ABSTRACT

Numerical computations are often specified in terms of operations on vectors and matrices. This is partly because it is often natural to do so; but it is also partly because, being otherwise useful, such operations have been provided very fast implementations in linear algebra libraries such as ATLAS (implementing BLAS), LAPACK, fftw, etc. Due to their better cache awareness and use of specialized processor instructions, a high-level invocation of an operation such as matrix multiplication using these libraries may execute orders of magnitude more quickly than a straightforward low-level implementation written in, say, C. The combination of efficiency and expressivity has made the framework of linear algebra an exceedingly popular one for scientists. For example, Matlab[1], an interpreter of a simple linear algebra language, has become a standard research tool in many fields.The process of expressing an algorithm in terms of matrices can be error-prone. Matlab and other popular matrix languages are dynamically-typed, which means that type errors are only detected at run-time. Even statically typed languages rarely keep track of more information in an object type than its tensor rank (e.g., to discriminate between matrices and vectors) and element type.If we could additionally expose object dimensions to the type system then we would ideally be able to detect a much wider variety of common errors at compile time than is currently possible. This would in turn make it easier to build and maintain larger numericsintensive software projects.We call our idea of exposing dimensions to the type system "strongly typed linear algebra". We have written a prototype implementation in Haskell, which is based on Alberto Ruiz's GSLHaskell[2] and which uses techniques from Kiselyov and Shan's "Implicit Configurations" paper[3].The presentation will cover the key aspects of our design such as the use of GADTs to combine matrix and vector types, and the use of higher-rank types and staging (namely, Template Haskell) to closely approximate a dependent-type system. Then, we will give a demonstration of interactive use, and compare our system to existing systems in the areas of speed and usability.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
Matlab. http://www.mathworks.com/.
 
2
A. Ruiz. Matrix computations in haskell based on the gsl. http://dis.um.es/~alberto/GSLHaskell/matrix.pdf, June 2005.
3
 
4
SciViews. http://www.sciviews.org/benchmark/index.html, August 2003.
 
5
J.W. Eaton. GNU Octave: a high-level interactive language for numerical applications. GNU/Free Software Foundation, Boston, 1998.
 
6
F. Eaton. Statically typed linear algebra in haskell (papers and sourcecode). http://ofb.net/~frederik/stla/, July 2006.