Results 1  10
of
18
Compiling Standard ML to Java bytecodes
 In Third ACM SIGPLAN International Conference on Functional Programming
, 1998
"... of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for pro t or commercial advantage and that copies bear this notice and the full citation on the rst page. Copyrights for components of this work owned by others than ACM ..."
Abstract

Cited by 105 (12 self)
 Add to MetaCart
of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for pro t or commercial advantage and that copies bear this notice and the full citation on the rst page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, to republish, to post on servers, or to redistribute to lists, requires prior
Implementing Typed Intermediate Languages
, 1998
"... Recent advances in compiler technology have demonstrated the benefits of using strongly typed intermediate languages to compile richly typed source languages (e.g., ML). A typepreserving compiler can use types to guide advanced optimizations and to help generate provably secure mobile code. Types, u ..."
Abstract

Cited by 61 (16 self)
 Add to MetaCart
Recent advances in compiler technology have demonstrated the benefits of using strongly typed intermediate languages to compile richly typed source languages (e.g., ML). A typepreserving compiler can use types to guide advanced optimizations and to help generate provably secure mobile code. Types, unfortunately, are very hard to represent and manipulate efficiently; a naive implementation can easily add exponential overhead to the compilation and execution of a program. This paper describes our experience with implementing the FLINT typed intermediate language in the SML/NJ production compiler. We observe that a typepreserving compiler will not scale to handle large types unless all of its typepreserving stages preserve the asymptotic time and space usage in representing and manipulating types. We present a series of novel techniques for achieving this property and give empirical evidence of their effectiveness.
Monads and Effects
 IN INTERNATIONAL SUMMER SCHOOL ON APPLIED SEMANTICS APPSEM’2000
, 2000
"... A tension in language design has been between simple semantics on the one hand, and rich possibilities for sideeffects, exception handling and so on on the other. The introduction of monads has made a large step towards reconciling these alternatives. First proposed by Moggi as a way of structu ..."
Abstract

Cited by 47 (6 self)
 Add to MetaCart
A tension in language design has been between simple semantics on the one hand, and rich possibilities for sideeffects, exception handling and so on on the other. The introduction of monads has made a large step towards reconciling these alternatives. First proposed by Moggi as a way of structuring semantic descriptions, they were adopted by Wadler to structure Haskell programs, and now offer a general technique for delimiting the scope of effects, thus reconciling referential transparency and imperative operations within one programming language. Monads have been used to solve longstanding problems such as adding pointers and assignment, interlanguage working, and exception handling to Haskell, without compromising its purely functional semantics. The course will introduce monads, effects and related notions, and exemplify their applications in programming (Haskell) and in compilation (MLj). The course will present typed metalanguages for monads and related categorica...
Free Theorems in the Presence of seq
, 2004
"... Parametric polymorphism constrains the behavior of pure functional programs in a way that allows the derivation of interesting theorems about them solely from their types, i.e., virtually for free. Unfortunately, the standard parametricity theorem fails for nonstrict languages supporting a polymorph ..."
Abstract

Cited by 36 (12 self)
 Add to MetaCart
Parametric polymorphism constrains the behavior of pure functional programs in a way that allows the derivation of interesting theorems about them solely from their types, i.e., virtually for free. Unfortunately, the standard parametricity theorem fails for nonstrict languages supporting a polymorphic strict evaluation primitive like Haskell's $\mathit{seq}$. Contrary to the folklore surrounding $\mathit{seq}$ and parametricity, we show that not even quantifying only over strict and bottomreflecting relations in the $\forall$clause of the underlying logical relation  and thus restricting the choice of functions with which such relations are instantiated to obtain free theorems to strict and total ones  is sufficient to recover from this failure. By addressing the subtle issues that arise when propagating up the type hierarchy restrictions imposed on a logical relation in order to accommodate the strictness primitive, we provide a parametricity theorem for the subset of Haskell corresponding to a GirardReynoldsstyle calculus with fixpoints, algebraic datatypes, and $\mathit{seq}$. A crucial ingredient of our approach is the use of an asymmetric logical relation, which leads to ``inequational'' versions of free theorems enriched by preconditions guaranteeing their validity in the described setting. Besides the potential to obtain corresponding preconditions for standard equational free theorems by combining some new inequational ones, the latter also have value in their own right, as is exemplified with a careful analysis of $\mathit{seq}$'s impact on familiar program transformations.
FlowDirected Closure Conversion for Typed Languages
 In ESOP '00 [ESOP00
, 2000
"... This paper presents a new closure conversion algorithm for simplytyped languages. We have have implemented the algorithm as part of MLton, a wholeprogram compiler for Standard ML (SML). MLton first applies all functors and eliminates polymorphism by code duplication to produce a simplytyped progr ..."
Abstract

Cited by 31 (1 self)
 Add to MetaCart
This paper presents a new closure conversion algorithm for simplytyped languages. We have have implemented the algorithm as part of MLton, a wholeprogram compiler for Standard ML (SML). MLton first applies all functors and eliminates polymorphism by code duplication to produce a simplytyped program. MLton then performs closure conversion to produce a firstorder, simplytyped program. In contrast to typical functional language implementations, MLton performs most optimizations on the firstorder language, after closure conversion. There are two notable contributions of our work: 1. The translation uses a general flowanalysis framework which includes OCFA. The types in the target language fully capture the results of the analysis. MLton uses the analysis to insert coercions to translate between different representations of a closure to preserve type correctness of the target language program. 2. The translation is practical. Experimental results over a range of benchmarks...
Monads, effects and transformations
 Electronic Notes in Theoretical Computer Science
, 1999
"... Abstract We define a typed compiler intermediate language, MILlite, which incorporates computational types refined with effect information. We characterise MILlite observational congruence by using Howe's method to prove a ciu theorem for the language in terms of a termination predicate defined di ..."
Abstract

Cited by 27 (9 self)
 Add to MetaCart
Abstract We define a typed compiler intermediate language, MILlite, which incorporates computational types refined with effect information. We characterise MILlite observational congruence by using Howe's method to prove a ciu theorem for the language in terms of a termination predicate defined directly on the term. We then define a logical predicate which captures an observable version of the intended meaning of each of our effect annotations. Having proved the fundamental theorem for this predicate, we use it with the ciu theorem to validate a number of effectbased transformations performed by the MLj compiler for Standard ML.
Correctness of Monadic State: An Imperative CallbyNeed Calculus
 In Proc. 25th ACM Symposium on Principles of Programming Languages
, 1998
"... The extension of Haskell with a builtin state monad combines mathematical elegance with operational efficiency: ffl Semantically, at the source language level, constructs that act on the state are viewed as functions that pass an explicit store data structure around. ffl Operationally, at the imp ..."
Abstract

Cited by 20 (2 self)
 Add to MetaCart
The extension of Haskell with a builtin state monad combines mathematical elegance with operational efficiency: ffl Semantically, at the source language level, constructs that act on the state are viewed as functions that pass an explicit store data structure around. ffl Operationally, at the implementation level, constructs that act on the state are viewed as statements whose evaluation has the sideeffect of updating the implicit global store in place. There are several unproven conjectures that the two views are consistent. Recently, we have noted that the consistency of the two views is far from obvious: all it takes for the implementation to become unsound is one judiciouslyplaced betastep in the optimization phase of the compiler. This discovery motivates the current paper in which we formalize and show the correctness of the implementation of monadic state. For the proof, we first design a typed callbyneed language that models the intermediate language of the compiler, to...
CallByPushValue: A Subsuming Paradigm
 in Proc. TLCA ’99
, 1999
"... . Callbypushvalue is a new paradigm that subsumes the callbyname and callbyvalue paradigms, in the following sense: both operational and denotational semantics for those paradigms can be seen as arising, via translations that we will provide, from similar semantics for callbypushvalue. To ..."
Abstract

Cited by 15 (0 self)
 Add to MetaCart
. Callbypushvalue is a new paradigm that subsumes the callbyname and callbyvalue paradigms, in the following sense: both operational and denotational semantics for those paradigms can be seen as arising, via translations that we will provide, from similar semantics for callbypushvalue. To explain callbypushvalue, we first discuss general operational ideas, especially the distinction between values and computations, using the principle that "a value is, a computation does". Using an example program, we see that the lambdacalculus primitives can be understood as push/pop commands for an operandstack. We provide operational and denotational semantics for a range of computational effects and show their agreement. We hence obtain semantics for callbyname and callbyvalue, of which some are familiar, some are new and some were known but previously appeared mysterious. 1 Introduction 1.1 Contribution In his invited lecture at POPL '98 [32], Reynolds, surveying over 30 year...
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 nontermination, exceptions, and state, in a callbyvalue 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 nontermination, exceptions, and state, in a callbyvalue 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.
The Impact of seq on Free TheoremsBased Program Transformations
 Fundamenta Informaticae
, 2006
"... Parametric polymorphism constrains the behavior of pure functional programs in a way that allows the derivation of interesting theorems about them solely from their types, i.e., virtually for free. Unfortunately, standard parametricity results — including socalled free theorems — fail for nonstrict ..."
Abstract

Cited by 13 (5 self)
 Add to MetaCart
Parametric polymorphism constrains the behavior of pure functional programs in a way that allows the derivation of interesting theorems about them solely from their types, i.e., virtually for free. Unfortunately, standard parametricity results — including socalled free theorems — fail for nonstrict languages supporting a polymorphic strict evaluation primitive such as Haskell’s seq. A folk theorem maintains that such results hold for a subset of Haskell corresponding to a GirardReynolds calculus with fixpoints and algebraic datatypes even when seq is present provided the relations which appear in their derivations are required to be bottomreflecting and admissible. In this paper we show that this folklore is incorrect, but that parametricity results can be recovered in the presence of seq by restricting attention to leftclosed, total, and admissible relations instead. The key novelty of our approach is the asymmetry introduced by leftclosedness, which leads to “inequational” versions of standard parametricity results together with preconditions guaranteeing their validity even when seq is present. We use these results to derive criteria ensuring that both equational and inequational versions of short cut fusion and related program transformations based on free theorems hold in the presence of seq.