An Array-Oriented Language with Static Rank Polymorphism
The array-computational model pioneered by Iverson’s languages APL and J offers a simple and expressive solution to the “von Neumann bottleneck.” It includes a form of rank, or dimensional, polymorphism, which renders much of a program’s control structure implicit by lifting base operators to higher-dimensional array structures. We present the first formal semantics for this model, along with the first static type system that captures the full power of the core language.
The formal dynamic semantics of our core language, Remora, illuminates several of the murkier corners of the model. This allows us to resolve some of the model’s ad hoc elements in more general, regular ways. Among these, we can generalise the model from SIMD to MIMD computations, by extending the semantics to permit functions to be lifted to higher-dimensional arrays in the same way as their arguments.
Our static semantics, a dependent type system of carefully restricted power, is capable of describing array computations whose dimensions cannot be determined statically. The type-checking problem is decidable and the type system is accompanied by the usual soundness theorems. Our type system’s principal contribution is that it serves to extract the implicit control structure that provides so much of the language’s expressive power, making this structure explicitly apparent at compile time.
KeywordsType System Iteration Space Array Type Type Annotation Core Language
- 2.Blelloch, G.: NESL: A nested data-parallel language (version 3.1). Tech. rep. (1995)Google Scholar
- 4.Brooks, F.P.: The Design of Design: Essays from a Computer Scientist. Addison-Wesley (2010)Google Scholar
- 5.Chakravarty, M.M.T., Leshchinskiy, R., Peyton Jones, S., Keller, G., Marlow, S.: Data parallel haskell: a status report. In: DAMP 2007: Workshop on Declarative Aspects of Multicore Programming, ACM Press (2007)Google Scholar
- 6.Felleisen, M., Findler, R.B., Flatt, M.: Semantics Engineering with PLT Redex, 1st edn. MIT Press (2009)Google Scholar
- 7.Iverson, K.E.: A programming language. John Wiley & Sons, Inc., New York (1962)Google Scholar
- 8.Jay, C.B.: The fish language definition. Tech. rep. (1998)Google Scholar
- 10.Jsoftware, Inc.: Jsoftware: High-performance development platform, http://www.jsoftware.com/
- 11.Keller, G., Chakravarty, M.M., Leshchinskiy, R., Peyton Jones, S., Lippmeier, B.: Regular, shape-polymorphic, parallel arrays in haskell. In: Proceedings of the 15th ACM SIGPLAN International Conference on Functional Programming, ICFP 2010, pp. 261–272. ACM, New York (2010)Google Scholar
- 13.Peyton Jones, S., Leshchinskiy, R., Keller, G., Chakravarty, M.M.: Harnessing the multicores: Nested data parallelism in haskell. In: FSTTCS, vol. 2, pp. 383–414 (2008)Google Scholar
- 14.Ragan-Kelley, J., Adams, A., Paris, S., Levoy, M., Amarasinghe, S., Durand, F.: Decoupling algorithms from schedules for easy optimization of image processing pipelines. ACM Trans. Graph. 31(4), 32:1–32:12 (2012)Google Scholar
- 18.Xi, H.: Dependent types in practical programming. Ph.D. thesis, Pittsburgh, PA, USA (1998) aAI9918624Google Scholar
- 20.Zima, H., Chapman, B.: Supercompilers for Parallel and Vector Computers. ACM Press (1990)Google Scholar