Results 1  10
of
20
Typedirected partial evaluation
 Proceedings of the TwentyThird Annual ACM Symposium on Principles of Programming Languages
, 1996
"... Abstract. Typedirected partial evaluation stems from the residualization of arbitrary static values in dynamic contexts, given their type. Its algorithm coincides with the one for coercing asubtype value into a supertype value, which itself coincides with the one of normalization in thecalculus. T ..."
Abstract

Cited by 207 (39 self)
 Add to MetaCart
Abstract. Typedirected partial evaluation stems from the residualization of arbitrary static values in dynamic contexts, given their type. Its algorithm coincides with the one for coercing asubtype value into a supertype value, which itself coincides with the one of normalization in thecalculus. Typedirected partial evaluation is thus used to specialize compiled, closed programs, given their type. Since Similix, letinsertion is a cornerstone of partial evaluators for callbyvalue procedural programs with computational e ects. It prevents the duplication of residual computations, and more generally maintains the order of dynamic side e ects in residual programs. This article describes the extension of typedirected partial evaluation to insert residual let expressions. This extension requires the userto annotate arrowtypes with e ect information. It is achieved by delimiting and abstracting control, comparably to continuationbased specialization in direct style. It enables typedirected partial evaluation of e ectful programs (e.g.,ade nitional lambdainterpreter for an imperative language) that are in direct style. The residual programs are in Anormal form. 1
A Semantic Account of TypeDirected Partial Evaluation
 In Gopalan Nadathur, editor, International Conference on Principles and Practice of Declarative Programming, number 1702 in Lecture
, 1999
"... We formally characterize partial evaluation of functional programs as a normalization problem in an equational theory, and derive a typebased normalizationbyevaluation algorithm for computing normal forms in this setting. We then establish the correctness of this algorithm using a semantic ar ..."
Abstract

Cited by 26 (2 self)
 Add to MetaCart
We formally characterize partial evaluation of functional programs as a normalization problem in an equational theory, and derive a typebased normalizationbyevaluation algorithm for computing normal forms in this setting. We then establish the correctness of this algorithm using a semantic argument based on Kripke logical relations. For simplicity, the results are stated for a nonstrict, purely functional language; but the methods are directly applicable to stating and proving correctness of typedirected partial evaluation in MLlike languages as well.
Two for the Price of One: Composing Partial Evaluation and Compilation
, 1997
"... One of the flagship applications of partial evaluation is compilation and compiler generation. However, partial evaluation is usually expressed as a sourcetosource transformation for highlevel languages, whereas realistic compilers produce object code. We close this gap by composing a partial eva ..."
Abstract

Cited by 21 (3 self)
 Add to MetaCart
One of the flagship applications of partial evaluation is compilation and compiler generation. However, partial evaluation is usually expressed as a sourcetosource transformation for highlevel languages, whereas realistic compilers produce object code. We close this gap by composing a partial evaluator with a compiler by automatic means. Our work is a successful application of several metacomputation techniques to build the system, both in theory and in practice. The composition is an application of deforestation or fusion. The result is a runtime code generation system built from existing components. Its applications are numerous. For example, it allows the language designer to perform interpreterbased experiments with a sourcetosource version of the partial evaluator before building a realistic compiler which generates object code automatically.
Modular Compilers Based on Monad Transformers
 In Proceedings of the IEEE International Conference on Computer Languages
, 1998
"... The monadic style of language specification has the advantages of modularity and extensibility: it is simple to add or change features in an interpreter to reflect modifications in the source language. It has proven difficult to extend the method to compilation. We demonstrate that by introducing ma ..."
Abstract

Cited by 19 (2 self)
 Add to MetaCart
The monadic style of language specification has the advantages of modularity and extensibility: it is simple to add or change features in an interpreter to reflect modifications in the source language. It has proven difficult to extend the method to compilation. We demonstrate that by introducing machinelike stores (code and data) into the monadic semantics and then partially evaluating the resulting semantic expressions, we can achieve many of the same advantages for a compiler as for an interpreter. A number of language constructs and features are compiled: expressions, CBV and CBN evaluation of expressions, dynamic scoping, and various imperative features. The treatment of recursive procedures is outlined as well. The resulting method allows compilers to be constructed in a mixandmatch fashion just as in a monadstructured interpreter. 1 Introduction and Related Work This paper concerns the construction of modular compilers for highlevel programming languages from reusable co...
Strong Normalization by TypeDirected Partial Evaluation and RunTime Code Generation
 PROCEEDINGS OF THE SECOND INTERNATIONAL WORKSHOP ON TYPES IN COMPILATION, NUMBER 1473 IN LECTURE NOTES IN COMPUTER SCIENCE
, 1997
"... We investigate the synergy between typedirected partial evaluation and runtime code generation for the Caml dialect of ML. Typedirected partial evaluation maps simply typed, closed Caml values to a representation of their long fijnormal form. Caml uses a virtual machine and has the capability ..."
Abstract

Cited by 17 (7 self)
 Add to MetaCart
We investigate the synergy between typedirected partial evaluation and runtime code generation for the Caml dialect of ML. Typedirected partial evaluation maps simply typed, closed Caml values to a representation of their long fijnormal form. Caml uses a virtual machine and has the capability to load byte code at run time. Representing the long fijnormal forms as byte code gives us the ability to strongly normalize higherorder values (i.e., weak head normal forms in ML), to compile the resulting strong normal forms into byte code, and to load this byte code all in one go, at run time. We conclude
Memoization in typedirected partial evaluation
 PROCEEDINGS OF THE 2002 ACM SIGPLAN/SIGSOFT CONFERENCE ON GENERATIVE PROGRAMMING AND COMPONENT ENGINEERING, NUMBER 2487 IN LECTURE NOTES IN COMPUTER SCIENCE
, 2002
"... We use a code generator—typedirected partial evaluation— to verify conversions between isomorphic types, or more precisely to verify that a composite function is the identity function at some complicated type. A typed functional language such as ML provides a natural support to express the function ..."
Abstract

Cited by 14 (6 self)
 Add to MetaCart
We use a code generator—typedirected partial evaluation— to verify conversions between isomorphic types, or more precisely to verify that a composite function is the identity function at some complicated type. A typed functional language such as ML provides a natural support to express the functions and typedirected partial evaluation provides a convenient setting to obtain the normal form of their composition. However, offtheshelf typedirected partial evaluation turns out to yield gigantic normal forms. We identify that this gigantism is due to redundancies, and that these redundancies originate in the handling of sums, which uses delimited continuations. We successfully eliminate these redundancies by extending typedirected partial evaluation with memoization capabilities. The result only works for pure functional programs, but it provides an unexpected use of code generation and it yields ordersofmagnitude improvements both in time and in space for type isomorphisms.
A Unifying Approach to GoalDirected Evaluation
 New Generation Computing
, 2001
"... Goaldirected evaluation, as embodied in Icon and Snobol, is built on the notions of backtracking and of generating successive results, and therefore it has always been something of a challenge to specify and implement. In this article, we address this challenge using computational monads and partia ..."
Abstract

Cited by 12 (4 self)
 Add to MetaCart
Goaldirected evaluation, as embodied in Icon and Snobol, is built on the notions of backtracking and of generating successive results, and therefore it has always been something of a challenge to specify and implement. In this article, we address this challenge using computational monads and partial evaluation. We consider a subset of Icon and we specify it with a monadic semantics and a list monad. We then consider a spectrum of monads that also fit the bill, and we relate them to each other. For example, we derive a continuation monad as a Church encoding of the list monad. The resulting semantics coincides with Gudeman's continuation semantics of Icon. We then compile Icon programs by specializing their interpreter (i.e., by using the first Futamura projection), using typedirected partial evaluation. Through various back ends, including a runtime code generator, we generate ML code, C code, and OCaml byte code. Bindingtime analysis and partial evaluation of the continuationbased interpreter automatically give rise to C programs that coincide with the result of Proebsting's optimized compiler.
The Second Futamura Projection for TypeDirected Partial Evaluation
 HIGHERORDER AND SYMBOLIC COMPUTATION
, 1999
"... A generating extension of a program specializes it with respect to some specified part of the input. A generating extension of a program can be formed trivially by applying a partial evaluator to the program; the second Futamura projection describes the automatic generation of nontrivial genera ..."
Abstract

Cited by 9 (2 self)
 Add to MetaCart
A generating extension of a program specializes it with respect to some specified part of the input. A generating extension of a program can be formed trivially by applying a partial evaluator to the program; the second Futamura projection describes the automatic generation of nontrivial generating extensions by applying a partial evaluator to itself with respect to the programs. We derive
From Proof Normalization to Compiler Generation and TypeDirected ChangeofRepresentation
, 1997
"... The main part of this thesis is a synthesis of considerations from Type Theory, Mathematical Logic/Proof Theory, and (Denotational) Semantics to perform various automatic program transformations ranging from normalization over currying and coercioninsertion to compiler derivation. At the core of o ..."
Abstract

Cited by 7 (1 self)
 Add to MetaCart
The main part of this thesis is a synthesis of considerations from Type Theory, Mathematical Logic/Proof Theory, and (Denotational) Semantics to perform various automatic program transformations ranging from normalization over currying and coercioninsertion to compiler derivation. At the core of our technique we have what has been described as "An Inverse of the Evaluation Functional for Typed calculus" [7]. It is essentially typedirected jexpansion followed by fireduction on certain terms. Quite independently of [7], jexpansion has been studied for its use in Partial Evaluation, where among other things it has been used to obtain a onepass CPStransformer [20]. It is some of the consequences of this coincidence [19] that are described in the following. Our approach will be purely syntactical and it is hoped that it marks a simplification on earlier treatments of the materiel. We have tried presenting the materiel based purely on the standard reduction properties for the simpl...
Metacomputationbased compiler architecture
 IN 5TH INTERNATIONAL CONFERENCE ON THE MATHEMATICS OF PROGRAM CONSTRUCTION
, 2000
"... This paper presents a modular and extensible style of language specification based on metacomputations. This style uses two monads to factor the static and dynamic parts of the specification, thereby staging the specification and achieving strong bindingtime separation. Because metacomputations are ..."
Abstract

Cited by 7 (4 self)
 Add to MetaCart
This paper presents a modular and extensible style of language specification based on metacomputations. This style uses two monads to factor the static and dynamic parts of the specification, thereby staging the specification and achieving strong bindingtime separation. Because metacomputations are defined interms of monads, they can be constructed modularly and extensibly using monad transformers. A number of language constructs are specified: expressions, control flow, imperative features, and block structure. Metacomputationstyle specification lends itself to semanticsdirected compilation, which we demonstrate by creating a modular compiler for a blockstructured, imperative while language.