Abstract
We present a type system for expressing size constraints on array types in an ML-style type system. The goal is to detect shape mismatches at compile-time, while being simpler than full dependent types. The main restrictions is that the only terms that can occur in types are array sizes, and syntactically they must be variables or constants. For those programs where this is not sufficient, we support a form of existential types, with the type system automatically managing the requisite book-keeping. We formalise a large subset of the type system in a small core language, which we prove sound. We also present an integration of the type system in the high-performance parallel functional language Futhark, and show on a collection of 44 representative programs that the restrictions in the type system are not too problematic in practice.
Original language | English |
---|---|
Title of host publication | ARRAY 2021 - Proceedings of the 7th ACM SIGPLAN International Workshop on Libraries, Languages and Compilers for Array Programming, co-located with PLDI 2021 |
Editors | Tze Meng Low, Jeremy Gibbons |
Number of pages | 14 |
Publisher | Association for Computing Machinery, Inc. |
Publication date | 2021 |
Pages | 1-14 |
Article number | 3464310 |
ISBN (Electronic) | 978-1-4503-8466-7 |
DOIs | |
Publication status | Published - 2021 |
Event | 7th ACM SIGPLAN International Workshop on Libraries, Languages, and Compilers for Array Programming, ARRAY 2021, held in association with PLDI 2021 - Virtual, Online, Canada Duration: 21 Jun 2021 → … |
Conference
Conference | 7th ACM SIGPLAN International Workshop on Libraries, Languages, and Compilers for Array Programming, ARRAY 2021, held in association with PLDI 2021 |
---|---|
Country/Territory | Canada |
City | Virtual, Online |
Period | 21/06/2021 → … |
Sponsor | ACM SIGPLAN |
Bibliographical note
Publisher Copyright:© 2021 ACM.
Keywords
- functional programming
- parallel programming
- type systems