Results 11 -
16 of
16
Integrating Partial Evaluators into Interpreters
- In Second International Workshop on Semantics, Applications and Implementation of Program Generation
, 2001
"... This paper describes our first step towards the integration of partial evaluation into standard interpretation. The two main issues in this integration are the treatment of heap objects and side-effects. ..."
Abstract
-
Cited by 3 (1 self)
- Add to MetaCart
This paper describes our first step towards the integration of partial evaluation into standard interpretation. The two main issues in this integration are the treatment of heap objects and side-effects.
Region-Based Program Specialization – An Operational Approach to Polymorphic Offline Partial Evaluation for ML-like Languages
, 2002
"... des Quellprogramms statisch, also wenig veränderlich ist; denn partielle Auswerter spezialisieren Programme, indem sie möglichst viele Operationen durch das aggressive Weiterleiten von Konstanten und das Entfalten von Funktionen bezüglich der statischen Eingabe reduzieren. Eine besonders viel benutz ..."
Abstract
-
Cited by 2 (2 self)
- Add to MetaCart
des Quellprogramms statisch, also wenig veränderlich ist; denn partielle Auswerter spezialisieren Programme, indem sie möglichst viele Operationen durch das aggressive Weiterleiten von Konstanten und das Entfalten von Funktionen bezüglich der statischen Eingabe reduzieren. Eine besonders viel benutzte Variante ist die offline partielle Auswertung, die durch Bindungszeitanalyse ermittelt, welche Operationen spezialisiert werden können. In der Vergangenheit haben offline-Systeme sich jedoch überwiegend auf naive Techniken zur Annotation von Bindungszeiten oder einfach getypte Programmiersprachen beschränkt. Das volle Potential der Methode wurde dadurch nicht annähernd ausgeschöpft; eine Integration von fortgeschrittenen Annotationstechniken und eine Erweiterung auf komplexere Typsysteme blieben, sowohl theoretisch als auch praktisch, offene und interessante Fragen. In der vorliegenden Arbeit präsentieren wir im Kontext ML-ähnlicher funktionaler Sprachen eine zufriedenstellende Antwort auf diese Fragen. Unsere grundlegende Idee ist es, Techniken aus dem Bereich der Speicherverwaltung zu erweitern und in den
First-Class Polyvariant Functions and Co-Arity Raising
"... In partial evaluation, a polyvariant function is specialized to different specialized versions, depending on the calling context. Usually, polyvariance is limited to named, top-level functions. We lift this restriction in a partial evaluator for a higher-order functional languages to obtain first-cl ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
In partial evaluation, a polyvariant function is specialized to different specialized versions, depending on the calling context. Usually, polyvariance is limited to named, top-level functions. We lift this restriction in a partial evaluator for a higher-order functional languages to obtain first-class polyvariant functions. These functions are partially static and specialize to a memoization table. Arity raising splits a partially static parameter of a function into its dynamic components. Co-arity raising is the dual to arity raising. It splits a partially static result of a function into its dynamic components. A specializer that performs co-arity raising can transform a function returning one result into a function that returns any number of results, including zero. This technique enables polyvariant functions to return partially static results. We demonstrate the use of these techniques in combination by specializing a typed interpreter for a simply-typed applied lambda calculus s...
Design, Languages
"... It is often hard to write programs that are efficient yet reusable. For example, an efficient implementation of Gaussian elimination should be specialized to the structure and known static properties of the input matrix. The most profitable optimizations, such as choosing the best pivoting or memoiz ..."
Abstract
- Add to MetaCart
It is often hard to write programs that are efficient yet reusable. For example, an efficient implementation of Gaussian elimination should be specialized to the structure and known static properties of the input matrix. The most profitable optimizations, such as choosing the best pivoting or memoization, cannot be expected of even an advanced compiler because they are specific to the domain, but expressing these optimizations directly makes for ungainly source code. Instead, a promising and popular way to reconcile efficiency with reusability is for a domain expert to write code generators. Two pillars of this approach are types and effects. Typed multilevel languages such as MetaOCaml ensure safety: a well-typed code generator neither goes wrong nor generates code that goes wrong. Side effects such as state and control ease correctness: an effectful generator can resemble the textbook presentation of an algorithm, as is familiar to domain experts, yet insert let for memoization and if for bounds-checking, as is necessary for efficiency. However, adding effects blindly renders multilevel types unsound. We introduce the first two-level calculus with control effects and a sound type system. We give small-step operational semantics as well as a continuation-passing style (CPS) translation. For soundness, our calculus restricts the code generator’s effects to the scope of generated binders. Even with this restriction, we can finally write efficient code generators for dynamic programming and numerical methods in direct style, like in algorithm textbooks, rather than in CPS or monadic style.
Partial Evaluation of Maple Programs By
"... NUMBER OF PAGES: 1, 104This work is dedicated to my wife, Kate. Partial Evaluation (PE) is a program transformation technique that generates a specialized version of a program with respect to a subset of its inputs. PE is an automatic approach to program generation and meta-programming. This thesis ..."
Abstract
- Add to MetaCart
NUMBER OF PAGES: 1, 104This work is dedicated to my wife, Kate. Partial Evaluation (PE) is a program transformation technique that generates a specialized version of a program with respect to a subset of its inputs. PE is an automatic approach to program generation and meta-programming. This thesis presents a method of partially evaluating Maple programs using a fully online methodology. We present an implementation called MapleMIX, and use it towards two goals. Firstly we show how MapleMIX can be used to generate optimized versions of generic programs written in Maple. Secondly we use MapleMIX to mine symbolic computation code for residual theorems, which we present as precise solutions to parametric problems encountered in Computer Algebra Systems. The implementation of MapleMIX has been modularized using a high-level intermediate language called M-form. Several syntax transformations from Maple to M-form make it an ideal representation for performing program specialization. Many specialization techniques have been explored including a novel online approach to handle
Computational Effects across Generated Binders Maintaining future-stage lexical scope
"... Code generation is the leading approach to making high-performance software reusable. Effects are indispensable in code generators, whether to report failures or to insert let-statements and ifguards. Extensive painful experience shows that unrestricted effects interact with generated binders in und ..."
Abstract
- Add to MetaCart
Code generation is the leading approach to making high-performance software reusable. Effects are indispensable in code generators, whether to report failures or to insert let-statements and ifguards. Extensive painful experience shows that unrestricted effects interact with generated binders in undesirable ways to produce unexpectedly unbound variables, or worse, unexpectedly bound ones. These subtleties prevent experts in the application domain, not in programming languages, from using and extending the generator. A pressing problem is thus to express the desired effects while regulating them so that the generated code is correct, or at least correctly scoped, by construction. In an imminently practical code-generation framework, we show how to express arbitrary effects, including mutable references and delimited control, that move open code across generated binders. The static types of our generator expressions not only ensure that a well-typed generator produces well-typed and well-scoped code, but also express the lexical scopes of generated binders and prevent mixing up variables with different scopes. This precise notion of lexical scope subsumes the complaints about intuitively wrong example generators in the literature. For the first time, we demonstrate statically safe let-insertion across an arbitrary number of binders. Our framework is implemented as a Haskell library that embeds an extensible typed higher-order domain-specific language. It may be regarded as ‘staged Haskell. ’ The library is convenient to use thanks to the maturity of Haskell, higher-order abstract syntax, and polymorphism over generated type environments.

