Results 11 - 20
of
34
Compilation by Transformation in Non-Strict Functional Languages
, 1995
"... In this thesis we present and analyse a set of automatic source-to-source program transformations that are suitable for incorporation in optimising compilers for lazy functional languages. These transformations improve the quality of code in many different respects, such as execution time and memory ..."
Abstract
-
Cited by 29 (1 self)
- Add to MetaCart
In this thesis we present and analyse a set of automatic source-to-source program transformations that are suitable for incorporation in optimising compilers for lazy functional languages. These transformations improve the quality of code in many different respects, such as execution time and memory usage. The transformations presented are divided in two sets: global transformations, which are performed once (or sometimes twice) during the compilation process; and a set of local transformations, which are performed before and after each of the global transformations, so that they can simplify the code before applying the global transformations and also take advantage of them afterwards. Many of the local transformations are simple, well known, and do not have major effects on their own. They become important as they interact with each other and with global transformations, sometimes in non-obvious ways. We present how and why they improve the code, and perform extensive experiments wit...
Formally Based Profiling for Higher-Order Functional Languages
, 1997
"... Costs Cost of Denoted Application A Case expression C Evaluating a thunk V Updating a thunk U Allocating a heap object H Entering an scc E vocabulary: ---cost center (cc): a label to which costs are attributed. ---cost attribution (`): a finite mapping of cost centers to costs. A cost attribution re ..."
Abstract
-
Cited by 29 (0 self)
- Add to MetaCart
Costs Cost of Denoted Application A Case expression C Evaluating a thunk V Updating a thunk U Allocating a heap object H Entering an scc E vocabulary: ---cost center (cc): a label to which costs are attributed. ---cost attribution (`): a finite mapping of cost centers to costs. A cost attribution records the total costs attributed to each cost center. Two cost attributions are combined using (an overloaded) + . We also use \Gamma to remove costs from an attribution. (` 1 + attr ` 2 )(cc) = ` 1 (cc) + cost ` 2 (cc) (` 1 \Gamma attr ` 2 )(cc) = ` 1 (cc) \Gamma cost ` 2 (cc) ---heap (\Gamma; \Delta; \Theta;\Omega\Gamma1 an annotated mapping from variable names to expressions. We use the notation \Gamma[x cc 7! e] to extend the heap \Gamma with a mapping from x to the expression e annotated with cost center cc. In general, the cost center attached to a heap binding is the cost center which enclosed that binding. It serves two purposes: to ensure correct cost attribution when a thunk (un...
Type Classes with Existential Types
, 1995
"... We argue that the novel combination of type classes and existential types in a single language yields significant expressive power. We explore this combination in the context of higher-order functional languages with static typing, parametric polymorphism, algebraic data types, and Hindley-Milner ty ..."
Abstract
-
Cited by 27 (0 self)
- Add to MetaCart
We argue that the novel combination of type classes and existential types in a single language yields significant expressive power. We explore this combination in the context of higher-order functional languages with static typing, parametric polymorphism, algebraic data types, and Hindley-Milner type inference. Adding existential types to an existing functional language that already features type classes requires only a minor syntactic extension. We first demonstrate how to provide existential quantification over type classes by extending the syntax of algebraic data type definitions and give examples of possible uses. We then develop a type system and a type inference algorithm for the resulting language. Finally, we present a formal semantics by translation to an implicitly-typed second-order l-calculus and show that the type system is semantically sound. Our extension has been implemented in the Chalmers Haskell B. system, and all examples from this paper have been developed using ...
Essential language support for generic programming
- In PLDI ’05
, 2005
"... “Concepts ” are an essential language feature needed to support generic programming in the large. Concepts allow for succinct expression of bounds on type parameters of generic algorithms, enable systematic organization of problem domain abstractions, and make generic algorithms easier to use. In th ..."
Abstract
-
Cited by 26 (4 self)
- Add to MetaCart
“Concepts ” are an essential language feature needed to support generic programming in the large. Concepts allow for succinct expression of bounds on type parameters of generic algorithms, enable systematic organization of problem domain abstractions, and make generic algorithms easier to use. In this paper we formalize the design of a type system and semantics for concepts that is suitable for non-type-inferencing languages. Our design shares much in common with the type classes of Haskell, though our primary influence is from best practices in the C ++ community, where concepts are used to document type requirements for templates in generic libraries. The technical development in this paper defines an extension to System F and a type-directed translation from the extension back to System F. The translation is proved sound; the proof is written in the human readable but machine checkable Isar language and has been automatically verified by the Isabelle proof assistant. This document was generated directly from the Isar theory files using Isabelle’s support for literate proofs.
The Design and Implementation of Mondrian
- In Proceedings of the Haskell Workshop
, 1997
"... The Haskell dialect Mondrian is designed using the explicit philosophy of keeping things simple and consistent. Mondrian generalizes some of Haskell's (too) complex constructs, and adds a few simple new ones. This results in a small, intuitively comprehensible language with an object oriented flavor ..."
Abstract
-
Cited by 19 (4 self)
- Add to MetaCart
The Haskell dialect Mondrian is designed using the explicit philosophy of keeping things simple and consistent. Mondrian generalizes some of Haskell's (too) complex constructs, and adds a few simple new ones. This results in a small, intuitively comprehensible language with an object oriented flavor. In this paper, we will present the design decisions we made for Mondrian. Furthermore, some of Mondrian's language constructs will be defined by translations into Haskell. 1 Introduction In the preface of the Haskell report [13] the hope is expressed that extensions or variants of the language will appear that incorporate experimental features. The language Mondrian is such an experiment. Mondrian evolved from Haskell by deleting and combining some of Haskell's more complicated constructs and adding a few simple new ones. Unlike the language Pizza [29], which is designed as a strict superset of Java [8], the major concern in designing Mondrian has been to keep the language as basic and do...
A Comparison of Imperative and Purely Functional Suffix Tree Constructions
- Science of Computer Programming
, 1995
"... We explore the design space of implementing suffix tree algorithms in the functional paradigm. We review the linear time and space algorithms of McCreight and Ukkonen. Based on a new terminology of nested suffixes and nested prefixes, we give a simpler and more declarative explanation of these algor ..."
Abstract
-
Cited by 16 (6 self)
- Add to MetaCart
We explore the design space of implementing suffix tree algorithms in the functional paradigm. We review the linear time and space algorithms of McCreight and Ukkonen. Based on a new terminology of nested suffixes and nested prefixes, we give a simpler and more declarative explanation of these algorithms than was previously known. We design two "naive" versions of these algorithms which are not linear time, but use simpler data structures, and can be implemented in a purely functional style. Furthermore, we present a new, "lazy" suffix tree construction which is even simpler. We evaluate both imperative and functional implementations of these algorithms. Our results show that the naive algorithms perform very favourably, and in particular, the lazy construction compares very well to all the others. 1 Introduction Suffix trees are the method of choice when a large sequence of symbols, the "text", is to be searched frequently for occurrences of short sequences, the "patterns". Given tha...
Functional logic overloading
, 2002
"... Functional logic overloading is a novel approach to userdefined overloading that extends Haskell’s concept of type classes in significant ways. Whereas type classes are conceptually predicates on types in standard Haskell, they are type functions in our approach. Thus, we can base type inference on ..."
Abstract
-
Cited by 15 (1 self)
- Add to MetaCart
Functional logic overloading is a novel approach to userdefined overloading that extends Haskell’s concept of type classes in significant ways. Whereas type classes are conceptually predicates on types in standard Haskell, they are type functions in our approach. Thus, we can base type inference on the evaluation of functional logic programs. Functional logic programming provides a solid theoretical foundation for type functions and, at the same time, allows for programmable overloading resolution strategies by choosing different evaluation strategies for functional logic programs. Type inference with type functions is an instance of type inference with constrained types, where the underlying constraint system is defined by a functional logic program. We have designed a variant of Haskell which supports our approach to overloading, and implemented a prototype frontend for the language.
Specifying C++ concepts
- In Proc. 33rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL
, 2006
"... C++ templates are key to the design of current successful mainstream libraries and systems. They are the basis of programming techniques in diverse areas ranging from conventional general-purpose programming to software for safetycritical embedded systems. Current work on improving templates focuses ..."
Abstract
-
Cited by 10 (0 self)
- Add to MetaCart
C++ templates are key to the design of current successful mainstream libraries and systems. They are the basis of programming techniques in diverse areas ranging from conventional general-purpose programming to software for safetycritical embedded systems. Current work on improving templates focuses on the notion of concepts (a type system for templates), which promises significantly improved error diagnostics and increased expressive power such as conceptbased overloading and function template partial specialization. This paper presents C++ templates with an emphasis on problems related to separate compilation. We consider the problem of how to express concepts in a precise way that is simple enough to be usable by ordinary programmers. In doing so, we expose a few weakness of the current specification of the C++ standard library and suggest a far more precise and complete specification. We also present a systematic way of translating our proposed concept definitions, based on use-patterns rather than function signatures, into constraint sets that can serve as convenient basis for concept checking in a compiler.
Compiling with Non-Parametric Polymorphism (Preliminary Report)
"... There is a middle ground between parametric and ad-hoc polymorphism in which a computation can depend upon a type parameter but is restricted to being defined at all types in an inductive fashion. We call such polymorphism non-parametric. We show how nonparametric polymorphism can be used to impleme ..."
Abstract
-
Cited by 7 (2 self)
- Add to MetaCart
There is a middle ground between parametric and ad-hoc polymorphism in which a computation can depend upon a type parameter but is restricted to being defined at all types in an inductive fashion. We call such polymorphism non-parametric. We show how nonparametric polymorphism can be used to implement a variety of useful language mechanisms including overloading, unboxed data representations in the presence of ML-style polymorphism, and canonical representations of equivalent types. We show that, by using a second-order, explicitly typed language extended with non-parametric operations, these mechanisms can be implemented without having to tag data with type information at runtime. Furthermore, this approach retains a "phase distinction" and permits static type checking and separate compilation. Our aim is to provide a unifying language, translation, and proof framework in which a variety of non-parametric mechanisms can be expressed and verified. 1 Introduction Polymorphism is the ...
Computing Science
, 1994
"... Profiling tools, which measure and display the dynamic space and time behaviour of programs, are essential for identifying execution bottlenecks. A variety of such tools exist for conventional languages, but almost none for non-strict functional languages. There is a good reason for this: lazy evalu ..."
Abstract
-
Cited by 6 (0 self)
- Add to MetaCart
Profiling tools, which measure and display the dynamic space and time behaviour of programs, are essential for identifying execution bottlenecks. A variety of such tools exist for conventional languages, but almost none for non-strict functional languages. There is a good reason for this: lazy evaluation means that the program is executed in an order which is not immediately apparent from the source code, so it is difficult to relate dynamically-gathered statistics back to the original source. This thesis examines the difficulties of profiling lazy higher-order functional languages and develops a profiling tool which overcomes them. It relates information about both the time and space requirements of the program back to the original source expressions identified by the programmer. Considerable attention is paid to the cost semantics with two abstract cost semantics, lexical scoping and evaluation scoping, being investigated. Experience gained from the two profiling schemes led to the d...

