Results 11 - 20
of
37
Improving CPS-Based Partial Evaluation: Writing Cogen by Hand
- University of Melbourne, Australia
, 1994
"... It is well-known that self-applicable partial evaluation can be used to generate compiler generators: cogen = mix(mix;mix), where mix is the specializer (partial evaluator) . However, writing cogen by hand gives several advantages: (1) Contrasting to when writing a self-applicable mix, one is not re ..."
Abstract
-
Cited by 15 (0 self)
- Add to MetaCart
It is well-known that self-applicable partial evaluation can be used to generate compiler generators: cogen = mix(mix;mix), where mix is the specializer (partial evaluator) . However, writing cogen by hand gives several advantages: (1) Contrasting to when writing a self-applicable mix, one is not restricted to write cogen in the same language as it treats [HL91]. (2) A handwritten cogen can be more efficient than a cogen generated by self-application; in particular, a handwritten cogen typically performs no (time consuming) environment manipulations whereas one generated by self-application does. (3) When working in statically typed languages with user defined data types, the self-application approach requires encoding data type values [Bon88, Lau91, DNBV91], resulting in relatively inefficient (cogen-generated) compilers that spend much of their time on coding and decoding. By writing cogen by hand, the coding problem is eliminated [HL91, BW93]. Specializers written in continuation p...
Portable Implementation of Continuation Operators in Imperative Languages by Exception Handling
- Lecture Notes in Computer Science
, 2001
"... This paper describes a scheme of manipulating (partial) continuations in imperative languages such as Java and C++ in a portable manner, where the portability means that this scheme does not depend on structure of the native stack frame nor implementation of virtual machines and runtime systems. Exc ..."
Abstract
-
Cited by 13 (1 self)
- Add to MetaCart
This paper describes a scheme of manipulating (partial) continuations in imperative languages such as Java and C++ in a portable manner, where the portability means that this scheme does not depend on structure of the native stack frame nor implementation of virtual machines and runtime systems. Exception handling plays a significant role in this scheme to reduce overheads. The scheme is based on program transformation, but in contrast to CPS transformation, our scheme preserves the call graph of the original program. This scheme has two important applications: transparent migration in mobile computation and checkpointing in a highly reliable system. The former technology enables running computations to move to a remote computer, while the latter one enables running computations to be saved into storages.
A Library of High Level Control Operators
- Lisp Pointers, ACM SIGPLAN Special Interest Publ. on Lisp
, 1993
"... Numerous high-level control operators, with various properties, exist in the literature. To understand or compare them is difficult since their definitions use quite different theoretical frameworks; moreover, to our knowledge, no implementation offers them all. This paper tries to explain control o ..."
Abstract
-
Cited by 11 (0 self)
- Add to MetaCart
Numerous high-level control operators, with various properties, exist in the literature. To understand or compare them is difficult since their definitions use quite different theoretical frameworks; moreover, to our knowledge, no implementation offers them all. This paper tries to explain control operators by the often simple stack manipulation they perform. We therefore present what we think these operators are, in an executable framework derived from abstract continuations. This library is published in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For instance, we do not claim our implementation to be faithful nor we attempt to formally derive these implementations from their original definitions. The goal is to give a flavor of what control operators are, from an implementation point of view. Last but worth to say, all errors are mine. Among the many existing control operators, w...
Three Steps for the CPS Transformation
, 1991
"... Transforming a #-term into continuation-passing style (CPS) might seem mystical at first, but in fact it can be characterized by three separate aspects: . The values of all intermediate applications are given a name. . The evaluation of these applications is sequentialized based on a traversal o ..."
Abstract
-
Cited by 9 (4 self)
- Add to MetaCart
Transforming a #-term into continuation-passing style (CPS) might seem mystical at first, but in fact it can be characterized by three separate aspects: . The values of all intermediate applications are given a name. . The evaluation of these applications is sequentialized based on a traversal of their syntax tree. This traversal mimics the reduction strategy. . The resulting term is equipped with a continuation --- a #-abstraction whose application to intermediate values yields the final result of the whole evaluation. The first point is fulfilled using the uniform naming mechanism of #-abstraction (Church encoding), which explains why continuations are represented as functions. The second point justifies why CPS terms are evaluation-order independent --- their evaluation order is determined by the syntax tree traversal of the CPS transformation. The third point captures the essence of the CPS transformation. We have staged Fischer and Plotkin's original CPS transformer accordin...
Search algorithms in type theory
, 2000
"... In this paper, we take an abstract view of search by describing search procedures via particular kinds of proofs in type theory. We rely on the proofs-as-programs interpretation to extract programs from our proofs. Using these techniques we explore, in depth, a large family of search problems by par ..."
Abstract
-
Cited by 8 (2 self)
- Add to MetaCart
In this paper, we take an abstract view of search by describing search procedures via particular kinds of proofs in type theory. We rely on the proofs-as-programs interpretation to extract programs from our proofs. Using these techniques we explore, in depth, a large family of search problems by parameterizing the speci cation of the problem. A constructive proof is presented which has as its computational content a correct search procedure for these problems. We show how a classical extension to an otherwise constructive system can be used to describe a typical use of the nonlocal control operator call/cc. Using the classical typing of nonlocal control we extend our purely constructive proof to incorporate a sophisticated backtracking technique known as ‘con ict-directed backjumping’ (CBJ). A variant of this proof is formalized in Nuprl yielding a correct-by-construction implementation of CBJ. The extracted program has been translated into Scheme and serves as the basis for an implementation of a new solution to the Hamiltonian circuit problem. This paper demonstrates a nontrivial application of the proofs-as-programs paradigm by applying the technique to the derivation of a sophisticated search algorithm; also, it shows the generality of the resulting implementation by demonstrating its application in a new problem
An Implementation of Transparent Migration on Standard Scheme
- Department of Computer Science, Rice University
, 2000
"... I present a handy (though somewhat restrictive) way to implement mobile computation a la Telescript on top of standard Scheme. Background. Mobile computation is an ecient and eective approach to distributed programming where a program works by migrating from one host to another. The migration is ca ..."
Abstract
-
Cited by 8 (0 self)
- Add to MetaCart
I present a handy (though somewhat restrictive) way to implement mobile computation a la Telescript on top of standard Scheme. Background. Mobile computation is an ecient and eective approach to distributed programming where a program works by migrating from one host to another. The migration is called transparent if the execution state of the program is preserved before and after the migration. Transparent migration is preferable to non-transparent, because it is easier to use for application programmers. At the same time, however, it is harder to implement for language developers: all existing implementations (to my knowledge) of transparent migration need either a custom runtime system (e.g. [13]) or global source code transformation (e.g. [12]). Our Method. In this presentation, I describe a library to enable transparent migration in standard Scheme. Unlike existing implementations, it requires neither modication of the runtime system nor transformation of the source code. It ...

