Results 11 - 20
of
32
Optimizing Lazy Functional Programs Using Flow Inference
, 1995
"... . Nonstrict higher order functional programming languages are notorious for their low run time efficiency. Optimizations based on flow analysis, which determines for each variable x in a program which expressions could have originated the value of x, can improve the situation by removing redundant ..."
Abstract
-
Cited by 19 (5 self)
- Add to MetaCart
. Nonstrict higher order functional programming languages are notorious for their low run time efficiency. Optimizations based on flow analysis, which determines for each variable x in a program which expressions could have originated the value of x, can improve the situation by removing redundant eval and thunk operations, avoiding thunk updates, and allowing the use of unboxed representations of some data. We formulate flow analysis as an inference problem in a type system built using type inclusion constraints and an algorithm for solving these constraints is also given. 1 Introduction Polymorphically typed nonstrict higher order functional programming languages are a boon to the programmer because they provide powerful mechanisms for abstraction [11]. Equally, and for the same reasons, they are very difficult to compile to efficient code. Among the main obstacles are the frequent need to build thunks (representations for unevaluated expressions), test whether objects are thunks o...
Compiling Standard ML For Efficient Execution On Modern Machines
, 1994
"... Many language theoreticians have taken great efforts in designing higher-level programming languages that are more elegant and more expressive than conventional languages. However, few of these new languages have been implemented very efficiently. The result is that most software engineers still pre ..."
Abstract
-
Cited by 18 (3 self)
- Add to MetaCart
Many language theoreticians have taken great efforts in designing higher-level programming languages that are more elegant and more expressive than conventional languages. However, few of these new languages have been implemented very efficiently. The result is that most software engineers still prefer to use conventional languages, even though the new higherlevel languages offer a better and simpler programming model. This dissertation concentrates on improving the performance of programs written in Standard ML (SML)---a statically typed functional language---on today's RISC machines. SML poses tough challenges to efficient implementations: very frequent function calls, polymorphic types, recursive data structures, higher-order functions, and first-class continuations. This dissertation presents the design and evaluation of several new compilation techniques that meet these challenges by taking advantage of some of the higher-level language features in SML. Type-directed compilation ...
Generalized Boxings, Congruences and Partial Inlining
"... . We present a new technique for optimizing programs, based on data-flow analysis. The initial goal was to provide a simple way to improve on Leroy and Peyton-Jones' techniques for optimizing boxings (allocations) and unboxings (field selection) away in strongly-typed functional programs. Our techni ..."
Abstract
-
Cited by 15 (0 self)
- Add to MetaCart
. We present a new technique for optimizing programs, based on data-flow analysis. The initial goal was to provide a simple way to improve on Leroy and Peyton-Jones' techniques for optimizing boxings (allocations) and unboxings (field selection) away in strongly-typed functional programs. Our techniques achieve this goal, while not needing types any more (so it applies to Lisp as well as to ML), and providing a finer analysis; moreover, our techniques also improve on classical common subexpression elimination. The methods are twofold: intraprocedurally, we use a data-flow analysis technique that propagates congruences on program variables and terms built on these variables; interprocedurally, we help the intraprocedural analysis by inlining, at least partially, all functions whose definitions are known at call sites. 1 Introduction One of the source of inefficiencies of compiled functional language implementations is the great number of boxings (allocating tuples on the heap) and unbo...
Unboxed Values and Polymorphic Typing Revisited
- In The Seventh International Conference on Functional Programming Languages and Computer Architecture
, 1995
"... Polymorphic languages require that values passed to polymorphic functions all have a representation of the same size. Any value whose natural representation does not fit this size must be boxed, i.e. represented by a pointer to a heap-allocated record. Major performance gains can be achieved by hand ..."
Abstract
-
Cited by 12 (0 self)
- Add to MetaCart
Polymorphic languages require that values passed to polymorphic functions all have a representation of the same size. Any value whose natural representation does not fit this size must be boxed, i.e. represented by a pointer to a heap-allocated record. Major performance gains can be achieved by handling values in their natural, unboxed representation whenever possible. We show that not only monomorphic functions, but also many polymorphic functions can handle unboxed values if the function calling convention of the underlying implementation satisfies a mild assumption. A representation type system is deøned which describes boxing requirements. A type reconstruction algorithm is given which translates an untyped program into an explicitly typed program where all changes of representation are made explicit. Furthermore, we define an abstract machine which employs the required calling convention and is an adequate operational model for the representation type system.
Full Lifting of Type Parameters
- in the proceedings of Second Fuji International Workshop on Functional and Logic Programming
, 1997
"... Recently explicit type parameter passing has been studied as an attractive approach to utilizing type information in ML. An important issue in this approach is to develop an efficient method of type parameter passing. Tolmach proposed a method based on lazy substitution on types and demonstrated the ..."
Abstract
-
Cited by 10 (0 self)
- Add to MetaCart
Recently explicit type parameter passing has been studied as an attractive approach to utilizing type information in ML. An important issue in this approach is to develop an efficient method of type parameter passing. Tolmach proposed a method based on lazy substitution on types and demonstrated the feasibility of his method in his implementation of tag-free garbage collection. However, there are still some significant costs associated with runtime construction of type parameters in his method. In this paper we propose a refinement of his method based on the transformation which completely eliminates runtime construction of type parameters. The transformation lifts type parameters that cause runtime construction so that they can be constructed statically. We present our transformation as a type preserving translation and prove the correctness of the translation. Furthermore, we describe an implementation of a compiler for Core Standard ML based on our method and compare our method to T...
Exact Flow Analysis
- In Proceedings of SAS’97, International Static Analysis Symposium
, 1997
"... We present a type-based ow analysis for simply typed lambda calculus with booleans, data-structures and recursion. The analysis is exact in the following sense: if the analysis predicts a redex, then there exists a reduction sequence (using standard reduction plus context propagation rules) such tha ..."
Abstract
-
Cited by 9 (0 self)
- Add to MetaCart
We present a type-based ow analysis for simply typed lambda calculus with booleans, data-structures and recursion. The analysis is exact in the following sense: if the analysis predicts a redex, then there exists a reduction sequence (using standard reduction plus context propagation rules) such that this redex will be reduced. The precision is accomplished using intersection typing. It follows that the analysis is non-elementary recursive | more surprisingly, the analysis is decidable. We argue that the specication of such an analysis provides a good starting point for developing new ow analyses and an important benchmark against which other ow analyses can be compared. Furthermore, we believe that the techniques employed for stating and proving exactness are of independent interest: they provide methods for reasoning about the precision of program analyses. 1
An Optimizing Backend for the ML Kit Using a Stack of Regions
, 1995
"... Recent research has shown that static memory management is a promising alternative to runtime garbage collection in higher order functional programming languages. Region inference determines where in a program memory can be allocated and deallocated in a stack like manner. We present an optimizing b ..."
Abstract
-
Cited by 9 (5 self)
- Add to MetaCart
Recent research has shown that static memory management is a promising alternative to runtime garbage collection in higher order functional programming languages. Region inference determines where in a program memory can be allocated and deallocated in a stack like manner. We present an optimizing backend for the ML Kit compiler building on region inference. As intermediate representation we use nested basic blocks. This representation allows optimizing transformations such as copy propagation, dead code elimination and register allocation to be more precise than if conventional flat basic blocks were used. We have implemented a code generator for the HPPA RISC architecture and experiments show that we in some cases generate faster code than the Standard ML of New Jersey compiler. In general, experiments show that the region based ML Kit compiler, when using our optimizing backend is comparable to the Standard ML of New Jersey compiler, not only regarding memory usage but also regarding execution time. 1
Compilation based on a calculus for explicit type passing
- In Proceedings of Fuji International Workshop on Functional and Logic Programming
, 1996
"... We propose several calculi for explicit type passing that enable us to formalize compilation of polymorphic programming languages like MLasphasesoftypepreserving translations. In our calculi various manipulations for type parameters can be expressed without typing problems|this is impossible in the ..."
Abstract
-
Cited by 8 (1 self)
- Add to MetaCart
We propose several calculi for explicit type passing that enable us to formalize compilation of polymorphic programming languages like MLasphasesoftypepreserving translations. In our calculi various manipulations for type parameters can be expressed without typing problems|this is impossible in the polymorphic-calculi. Furthermore, we develop the translation from an explicit typed source calculus similar to Core-XML to one of the proposed calculi which completely eliminates runtime construction type parameters. We proposeanintermediate language based on this calculus, and discuss an implementation of a compiler for Core Standard ML. 1.
A Simple Approach To Supporting Untagged Objects In Dynamically Typed Languages
"... This paper discusses a straightforward approach to using untagged and unboxed values in dynamically typed languages. An implementation of our algorithms allows a dynamically typed language to attain performance close to that of highly optimized C code on a variety of benchmarks (including many float ..."
Abstract
-
Cited by 6 (3 self)
- Add to MetaCart
This paper discusses a straightforward approach to using untagged and unboxed values in dynamically typed languages. An implementation of our algorithms allows a dynamically typed language to attain performance close to that of highly optimized C code on a variety of benchmarks (including many floating-point intensive computations) and dramatically reduces heap usage. \Delta 1. Introduction
Pragmatic Aspects of Type-Directed Partial Evaluation
, 1996
"... Type-directed partial evaluation stems from the residualization of static values in dynamic contexts, given their type and the type of their free variables. Its algorithm coincides with the algorithm for coercing a subtype value into a supertype value, which itself coincides with Berger and Schw ..."
Abstract
-
Cited by 5 (0 self)
- Add to MetaCart
Type-directed partial evaluation stems from the residualization of static values in dynamic contexts, given their type and the type of their free variables. Its algorithm coincides with the algorithm for coercing a subtype value into a supertype value, which itself coincides with Berger and Schwichtenberg's normalization algorithm for the simply typed -calculus. Type-directed partial evaluation thus can be used to specialize a compiled, closed program, given its type.

