Results 11 - 20
of
38
Optimizing ML Using a Hierarchy of Monadic Types
- WORKSHOP ON TYPES IN COMPILATION, KYOTO
, 1998
"... We describe a type system and typed semantics that use a hierarchy of monads to describe and delimit a variety of effects, including non-termination, exceptions, and state, in a call-by-value functional language. The type system and semantics can be used to organize and justify avariety of optimiz ..."
Abstract
-
Cited by 13 (0 self)
- Add to MetaCart
We describe a type system and typed semantics that use a hierarchy of monads to describe and delimit a variety of effects, including non-termination, exceptions, and state, in a call-by-value functional language. The type system and semantics can be used to organize and justify avariety of optimizing transformations in the presence of effects. In addition, we describe a simple monad inferencing algorithm that computes the minimum effect for each subexpression of a program, and provides more accurate effects information than local syntactic methods.
Optimal Type Lifting
- In Second Workshop on Types in Compilation
, 1998
"... . Modern compilers for ML-like polymorphic languages have used explicit run-time type passing to support advanced optimizations such as intensional type analysis, representation analysis and tagless garbage collection. Unfortunately, maintaining type information at run time can incur a large overhea ..."
Abstract
-
Cited by 13 (2 self)
- Add to MetaCart
. Modern compilers for ML-like polymorphic languages have used explicit run-time type passing to support advanced optimizations such as intensional type analysis, representation analysis and tagless garbage collection. Unfortunately, maintaining type information at run time can incur a large overhead to the time and space usage of a program. In this paper, we present an optimal type-lifting algorithm that lifts all type applications in a program to the top level. Our algorithm eliminates all run-time type constructions within any core-language functions. In fact, it guarantees that the number of types built at run time is strictly a static constant. We present our algorithm as a type-preserving source-to-source transformation and show how to extend it to handle the entire SML'97 with higher-order modules. 1 Introduction Modern compilers for ML-like polymorphic languages [16, 17] usually use variants of the Girard-Reynolds polymorphic -calculus [5, 26] as their intermediate language (I...
Faithful Translations between Polyvariant Flows and Polymorphic Types
, 2000
"... Recent work h& s h wn equivalences between various type systems and flow logics. Ideally, th translations upon wh= h such equivalences are basedshd&@ be faithful in th sense the information is not lost in round-trip translations from flows to types and back or from types to flows and back. Building ..."
Abstract
-
Cited by 11 (2 self)
- Add to MetaCart
Recent work h& s h wn equivalences between various type systems and flow logics. Ideally, th translations upon wh= h such equivalences are basedshd&@ be faithful in th sense the information is not lost in round-trip translations from flows to types and back or from types to flows and back. Building on t h work of Nielson Nielson and of Palsberg Pavlopoulou, we present t h firstfaithT# translations between a class of finitary polyvariant flow analyses and a type system supporting polymorph@@ in th form of intersection and union types. Additionally, our flow/type correspondence solves several open problems posed by Palsberg Pavlopoulou: (1) it expresses call-string based polyvariance (such as k-CFA) as well as argument based polyvariance; (2) it enjoys a subject reduction property for flows as well as for types; and (3) it supports a flow-oriented perspectiverath# thh a type-oriented one. 1
The GRIN Project: A Highly Optimising Back End for Lazy Functional Languages
- In Proc IFL ’96, volume 1268 of LNCS
, 1996
"... Low level optimisations from conventional compiler technology often give very poor results when applied to code from lazy functional languages, mainly because of the completely dioeerent structure of the code, unknown control flow, etc. A novel approach to compiling laziness is needed. We describe a ..."
Abstract
-
Cited by 11 (0 self)
- Add to MetaCart
Low level optimisations from conventional compiler technology often give very poor results when applied to code from lazy functional languages, mainly because of the completely dioeerent structure of the code, unknown control flow, etc. A novel approach to compiling laziness is needed. We describe a complete back end for lazy functional languages, which uses various interprocedural optimisations to produce highly optimised code. The main features of our new back end are the following. It uses a monadic intermediate code, called GRIN (Graph Reduction Intermediate Notation). This code has a very "functional flavour", making it well suited for analysis and program transformations, but at the same time provides the "low level" machinery needed to express many concrete implementation concerns. Using a heap points-to analysis, we are able to eliminate most unknown control flow due to evals (i.e., forcing of closures) and applications of higher order functions, in the program. A transformat...
Program Representation Size in an Intermediate Language with Intersection and Union Types
- In Proceedings of the Third Workshop on Types in Compilation (TIC 2000
, 2000
"... The CIL compiler for core Standard ML compiles whole programs using a novel typed intermediate language (TIL) with intersection and union types and ow labels on both terms and types. The CIL term representation duplicates portions of the program where intersection types are introduced and union ..."
Abstract
-
Cited by 9 (7 self)
- Add to MetaCart
The CIL compiler for core Standard ML compiles whole programs using a novel typed intermediate language (TIL) with intersection and union types and ow labels on both terms and types. The CIL term representation duplicates portions of the program where intersection types are introduced and union types are eliminated. This duplication makes it easier to represent type information and to introduce customized data representations. However, duplication incurs compiletime space costs that are potentially much greater than are incurred in TILs employing type-level abstraction or quanti cation. In this paper, we present empirical data on the compile-time space costs of using CIL as an intermediate language. The data shows that these costs can be made tractable by using suciently ne-grained ow analyses together with standard hash-consing techniques. The data also suggests that nonduplicating formulations of intersection (and union) types would not achieve signi cantly better space complexity.
Context Patterns in Haskell
- In 8th Int. Workshop on Implementation of Functional Languages, LNCS 1268
, 1996
"... In modern functional languages, pattern matching is used to define functions or expressions by performing an analysis of the structure of values. We extend Haskell with a new nonlocal form of patterns called context patterns, which allow the matching of subterms without fixed distance from the root ..."
Abstract
-
Cited by 8 (2 self)
- Add to MetaCart
In modern functional languages, pattern matching is used to define functions or expressions by performing an analysis of the structure of values. We extend Haskell with a new nonlocal form of patterns called context patterns, which allow the matching of subterms without fixed distance from the root of the whole term. The semantics of context patterns is defined by transforming them to standard Haskell programs. Typical applications of context patterns are functions which search a data structure and possibly transform it. This concept can easily be adopted for other languages using pattern matching like ML or Clean.
Space Issues in Compiling with Intersection and Union Types
, 2000
"... The CIL compiler for core Standard ML compiles whole programs using the CIL typed intermediate language with ow labels and intersection and union types. Flow labels embed flow information in the types and intersection and union types support precise polyvariant type and flow information, without the ..."
Abstract
-
Cited by 6 (5 self)
- Add to MetaCart
The CIL compiler for core Standard ML compiles whole programs using the CIL typed intermediate language with ow labels and intersection and union types. Flow labels embed flow information in the types and intersection and union types support precise polyvariant type and flow information, without the use of type-level abstraction or quantification. Compile-time representations of CIL types and terms are potentially large compared to those for similar types and terms in systems based on quantified types. The listing-based nature of intersection and union types, together with flow label annotations on types, contribute to the size of CIL types. The CIL term representation duplicates portions of the program where intersection types are introduced and union types are eliminated. This duplication makes it easier to represent type information and to introduce multiple representation conventions, but incurs a compile-time space cost. This paper presents empirical data on the compile-time space cos...
The Multi-Architecture Performance of the Parallel Functional Language
, 2000
"... . In principle, functional languages promise straightforward architecture-independent parallelism, because of their high level description of parallelism, dynamic management of parallelism and deterministic semantics. However, these language features come at the expense of a sophisticated compil ..."
Abstract
-
Cited by 6 (1 self)
- Add to MetaCart
. In principle, functional languages promise straightforward architecture-independent parallelism, because of their high level description of parallelism, dynamic management of parallelism and deterministic semantics. However, these language features come at the expense of a sophisticated compiler and/or runtime-system. The problem we address is whether such an elaborate system can deliver acceptable performance on a variety of parallel architectures. In particular we report performance measurements for the GUM runtime-system on eight parallel architectures, including massively parallel, distributed-memory, shared-memory and workstation networks. c Springer-Verlag; to appear in \Euro-Par 2000 | Parallel Processing" 1 Introduction Parallel functional languages have several features that should, in theory, enable good performance on a range of platforms. They are typically only semi-explicit about parallelism, containing limited explicit control of parallel behaviour. Inste...
Types for Register Allocation
- Lecture Notes in Computer Science
, 1998
"... . We have set out to explore a type based approach to register allocation for purely functional languages. To lay a theoretical ground for that work, we have first developed a functional typed intermediate language with explicit register usage that we present in this paper. The language, which is a ..."
Abstract
-
Cited by 6 (1 self)
- Add to MetaCart
. We have set out to explore a type based approach to register allocation for purely functional languages. To lay a theoretical ground for that work, we have first developed a functional typed intermediate language with explicit register usage that we present in this paper. The language, which is a lambda calculus with flavours of assembly language, is able to express the register assignments resulting from a global, graph coloring based register allocation. We prove that our system is consistent and correct with respect to a standard semantics. 1 Introduction Register allocation is the process of deciding where, in which register or in the memory, to store each value computed by the program being compiled. In modern RISC architectures, the difference in access time between a register and a memory cell can be as much as 4 to 10 times (or much more if a cache miss occurs) [1]. The register utilisation thus has a significant impact on the execution speed of a program. mov 3,%r8 mov 5,%r...
A certified framework for compiling and executing garbage-collected languages
- In ICFP
, 2010
"... We describe the design, implementation, and use of a machinecertified framework for correct compilation and execution of programs in garbage-collected languages. Our framework extends Leroy’s Coq-certified Compcert compiler and Cminor intermediate language. We add: (i) a new intermediate language, G ..."
Abstract
-
Cited by 6 (0 self)
- Add to MetaCart
We describe the design, implementation, and use of a machinecertified framework for correct compilation and execution of programs in garbage-collected languages. Our framework extends Leroy’s Coq-certified Compcert compiler and Cminor intermediate language. We add: (i) a new intermediate language, GCminor, that includes primitives for allocating memory in a garbage-collected heap and for specifying GC roots; (ii) a precise, low-level specification for a Cminor library for garbage collection; and (iii) a proven semantics-preserving translation from GCminor to Cminor plus the GC library. GCminor neatly encapsulates the interface between mutator and collector code, while remaining simple and flexible enough to be used with a wide variety of source languages and collector styles. Front ends targeting GCminor can be implemented using any compiler technology and any desired degree of verification, including full semantics preservation, type preservation, or informal trust. As an example application of our framework, we describe a compiler for Haskell that translates the Glasgow Haskell Compiler’s Core intermediate language to GCminor. To support a simple but useful memory safety argument for this compiler, the front end uses a novel combination of type preservation and runtime checks, which is of independent interest.

