Results 1 -
7 of
7
Associated Types with Class
- In POPL ’05: Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
, 2005
"... In this paper, we explore an extension to Haskell type classes that allows a type class declaration to define data types as well as values (or methods). Similarly, an instance declaration gives a witness for such data types, as well as a witness for each method. It turns out that this extension dire ..."
Abstract
-
Cited by 63 (18 self)
- Add to MetaCart
In this paper, we explore an extension to Haskell type classes that allows a type class declaration to define data types as well as values (or methods). Similarly, an instance declaration gives a witness for such data types, as well as a witness for each method. It turns out that this extension directly supports the idea of a type-indexed type, and is useful in many applications, especially for self-optimising libraries that adapt their data representations and algorithms in a type-directed manner.
Harnessing the Multicores: Nested Data Parallelism in Haskell
, 2008
"... ABSTRACT. If you want to program a parallel computer, a purely functional language like Haskell is a promising starting point. Since the language is pure, it is by-default safe for parallel evaluation, whereas imperative languages are by-default unsafe. But that doesn’t make it easy! Indeed it has p ..."
Abstract
-
Cited by 17 (6 self)
- Add to MetaCart
ABSTRACT. If you want to program a parallel computer, a purely functional language like Haskell is a promising starting point. Since the language is pure, it is by-default safe for parallel evaluation, whereas imperative languages are by-default unsafe. But that doesn’t make it easy! Indeed it has proved quite difficult to get robust, scalable performance increases through parallel functional programming, especially as the number of processors increases. A particularly promising and well-studied approach to employing large numbers of processors is data parallelism. Blelloch’s pioneering work on NESL showed that it was possible to combine a rather flexible programming model (nested data parallelism) with a fast, scalable execution model (flat data parallelism). In this paper we describe Data Parallel Haskell, which embodies nested data parallelism in a modern, general-purpose language, implemented in a state-of-the-art compiler, GHC. We focus particularly on the vectorisation transformation, which transforms nested to flat data parallelism. 1
Rewriting Haskell Strings
- In Practical Aspects of Declarative Languages 8th International Symposium, PADL 2007
, 2007
"... Abstract The Haskell String type is notoriously inefficient. We introduce a new data type, ByteString, based on lazy lists of byte arrays, combining the speed benefits of strict arrays with lazy evaluation. Equational transformations based on term rewriting are used to deforest intermediate ByteStri ..."
Abstract
-
Cited by 14 (6 self)
- Add to MetaCart
Abstract The Haskell String type is notoriously inefficient. We introduce a new data type, ByteString, based on lazy lists of byte arrays, combining the speed benefits of strict arrays with lazy evaluation. Equational transformations based on term rewriting are used to deforest intermediate ByteStrings automatically. We describe novel fusion combinators with improved expressiveness and performance over previous functional array fusion strategies. A library for ByteStrings is implemented, providing a purely functional interface, which approaches the speed of low-level mutable arrays in C.
With-Loop Scalarization: Merging Nested Array Operations
- Proceedings of the 15th International Workshop on Implementation of Functional Languages (IFL’03
, 2004
"... Abstract. Construction of complex array operations by composition of more basic ones allows for abstract and concise specifications of algorithms. Unfortunately, naïve compilation of such specifications leads to creation of many temporary arrays at runtime and, consequently, to poor performance char ..."
Abstract
-
Cited by 6 (4 self)
- Add to MetaCart
Abstract. Construction of complex array operations by composition of more basic ones allows for abstract and concise specifications of algorithms. Unfortunately, naïve compilation of such specifications leads to creation of many temporary arrays at runtime and, consequently, to poor performance characteristics. This paper elaborates on a new compiler optimization, named withloop-scalarization, which aims at eliminating temporary arrays in the context of nested array operations. It is based on with-loops, a versatile array comprehension construct used by the functional array language SaC both for specification as well as for internal representation of array operations. The impact of with-loop-scalarization on the runtime performance of compiled SaC code is demonstrated by several experiments involving support for arithmetic on arrays of complex numbers and the application kernel FT from the NAS benchmark suite. 1
Fine-grained visualization pipelines and lazy functional languages
- IEEE TRANSACTIONS ON VISUALIZATION AND COMPUTER GRAPHICS
, 2006
"... ..."
Merging Compositions of Array Skeletons in SAC
"... Permission to make digital or hard copies of portions of this work for personal or classroom use is granted provided that the copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise requires pri ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
Permission to make digital or hard copies of portions of this work for personal or classroom use is granted provided that the copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise requires prior specific permission by the publisher mentioned above.
Unboxed Polymorphic Objects for Functional Numerical Programming
, 2012
"... One approach to making numerical algorithms easier to write and understand is to provide a high-level library of polymorphic container types and higher-order functions for manipulating collections of data. Although polymorphic functions and data types are a common feature of programming languages, p ..."
Abstract
- Add to MetaCart
One approach to making numerical algorithms easier to write and understand is to provide a high-level library of polymorphic container types and higher-order functions for manipulating collections of data. Although polymorphic functions and data types are a common feature of programming languages, programming language implementations conventionally rely on compile-time knowledge of data layout when generating machine code. Ensuring that sizes are known at compile time requires boxing objects, which sacrifices performance; dynamically compiling functions, which requires heavyweight runtime support; prohibiting first-class polymorphism, which limits expressiveness; or using a predetermined set of monomorphic data types, which limits the range of usable types. To use efficient data layouts in statically compiled polymorphic code without limiting the use of polymorphism, we propose a low-level language that allows object sizes to depend on run-time type information. This language is used as an intermediate language in our prototype compiler, Triolet. So that users do not need to be aware of the details of data layout and object sizes, we further propose a translation from a high-level, fully boxed language to the internal language. To evaluate Triolet, we measured the performance of a number of functional numerical algorithms. These algorithms use a library of data types and functions, some of which utilize first-class polymorphism. These algorithms achieve 52 % of the performance of equivalent monomorphic implementations in C, often allocating the same amount of memory. In contrast, using boxed arrays slows down Triolet by 2.87. These results demonstrate that it is possible to achieve efficient data layout in this style of numerical code, and good data layout is key to achieving good performance. 1

