Results 1 - 10
of
34
Abstracting Control
- In Proceedings of the 1990 ACM Conference on LISP and Functional Programming
, 1990
"... The last few years have seen a renewed interest in continuations for expressing advanced control structures in programming languages, and new models such as Abstract Continuations have been proposed to capture these dimensions. This article investigates an alternative formulation, exploiting the lat ..."
Abstract
-
Cited by 79 (3 self)
- Add to MetaCart
The last few years have seen a renewed interest in continuations for expressing advanced control structures in programming languages, and new models such as Abstract Continuations have been proposed to capture these dimensions. This article investigates an alternative formulation, exploiting the latent expressive power of the standard continuation-passing style (CPS) instead of introducing yet other new concepts. We build on a single foundation: abstracting control as a hierarchy of continuations, each one modeling a specific language feature as acting on nested evaluation contexts. We show how iterating the continuation-passing conversion allows us to specify a wide range of control behavior. For example, two conversions yield an abstraction of Prologstyle backtracking. A number of other constructs can likewise be expressed i...
Hybrid Group Reflective Architecture for Object-Oriented Concurrent Reflective Programming
, 1991
"... The benefits of computational reflection are the abilities to reason and alter the dynamic behavior of computation from within the language framework. This is more beneficial in concurrent/distributed computing, where the complexity of the system is much greater compared to sequential computing; ..."
Abstract
-
Cited by 64 (8 self)
- Add to MetaCart
The benefits of computational reflection are the abilities to reason and alter the dynamic behavior of computation from within the language framework. This is more beneficial in concurrent/distributed computing, where the complexity of the system is much greater compared to sequential computing; we have demonstrated various benefits in our past research of Object-Oriented Concurrent Reflective (OOCR) architectures. Unfortunately, attempts to formulate reflective features provided in practical reflective systems, such as resource management, have led to some difficulties in maintaining the linguistic lucidity necessary in computational reflection. The primary reason is that previous OOCR architectures lack the ingredients for group-wide object coordination. We present a new OOCR language with a hybrid group reflective architecture, ABCL/R2, whose key features are the notion of heterogeneous object groups and coordinated management of group shared resources. We describe and gi...
Implementing Multi-stage Languages Using ASTs, Gensym, and Reflection
- In Krzysztof Czarnecki, Frank Pfenning, and Yannis Smaragdakis, editors, Generative Programming and Component Engineering (GPCE), Lecture Notes in Computer Science
, 2003
"... The paper addresses theoretical and practical aspects of implementing multi-stage languages using abstract syntax trees (ASTs), gensym, and reflection. We present an operational account of the correctness of this approach, and report on our experience with a bytecode compiler called MetaOCaml th ..."
Abstract
-
Cited by 40 (10 self)
- Add to MetaCart
The paper addresses theoretical and practical aspects of implementing multi-stage languages using abstract syntax trees (ASTs), gensym, and reflection. We present an operational account of the correctness of this approach, and report on our experience with a bytecode compiler called MetaOCaml that is based on this strategy. Current performance measurements reveal interesting characteristics of the underlying OCaml compiler, and illustrate why this strategy can be particularly useful for implementing domain-specific languages in a typed, functional setting.
Reflection in logic, functional and object-oriented programming: a Short Comparative Study
- In IJCAI '95 Workshop on Reflection and Metalevel Architectures and their Applications in AI
, 1995
"... Reflection is a wide-ranging concept that has been studied independently in many different areas of science in general, and computer science in particular. Even in the sub-area of programming languages, it has been applied to different paradigms, especially the logic, functional and objectoriented o ..."
Abstract
-
Cited by 31 (1 self)
- Add to MetaCart
Reflection is a wide-ranging concept that has been studied independently in many different areas of science in general, and computer science in particular. Even in the sub-area of programming languages, it has been applied to different paradigms, especially the logic, functional and objectoriented ones. Partly because of different past influences, but also because researchers in these communities scarcely talk to each others, concepts have evolved separately, sometimes to the point where it is hard for people in one community to recognize similarities in the work of others, not to speak about cross-fertilization among them. In this paper, we propose a synthesis covering mainly the application of computation reflection to programming languages. We compare the different approaches and try to identify similar concepts hidden behind different names or constructs. We also point out the different emphasis that has been given to different concepts in each of them. We do not claim neither comp...
A rational deconstruction of Landin’s SECD machine
- Implementation and Application of Functional Languages, 16th International Workshop, IFL’04, number 3474 in Lecture Notes in Computer Science
, 2004
"... Abstract. Landin’s SECD machine was the first abstract machine for applicative expressions, i.e., functional programs. Landin’s J operator was the first control operator for functional languages, and was specified by an extension of the SECD machine. We present a family of evaluation functions corre ..."
Abstract
-
Cited by 23 (16 self)
- Add to MetaCart
Abstract. Landin’s SECD machine was the first abstract machine for applicative expressions, i.e., functional programs. Landin’s J operator was the first control operator for functional languages, and was specified by an extension of the SECD machine. We present a family of evaluation functions corresponding to this extension of the SECD machine, using a series of elementary transformations (transformation into continuation-passing style (CPS) and defunctionalization, chiefly) and their left inverses (transformation into direct style and refunctionalization). To this end, we modernize the SECD machine into a bisimilar one that operates in lockstep with the original one but that (1) does not use a data stack and (2) uses the caller-save rather than the callee-save convention for environments. We also identify that the dump component of the SECD machine is managed in a callee-save way. The caller-save counterpart of the modernized SECD machine precisely corresponds to Thielecke’s doublebarrelled continuations and to Felleisen’s encoding of J in terms of call/cc. We then variously characterize the J operator in terms of CPS and in terms of delimited-control operators in the CPS hierarchy. As a byproduct, we also present several reduction semantics for applicative expressions
Delimited Dynamic Binding
, 2006
"... Dynamic binding and delimited control are useful together in many settings, including Web applications, database cursors, and mobile code. We examine this pair of language features to show that the semantics of their interaction is ill-defined yet not expressive enough for these uses. We solve this ..."
Abstract
-
Cited by 23 (8 self)
- Add to MetaCart
Dynamic binding and delimited control are useful together in many settings, including Web applications, database cursors, and mobile code. We examine this pair of language features to show that the semantics of their interaction is ill-defined yet not expressive enough for these uses. We solve this open and subtle problem. We formalise a typed language DB+DC that combines a calculus DB of dynamic binding and a calculus DC of delimited control. We argue from theoretical and practical points of view that its semantics should be based on delimited dynamic binding: capturing a delimited continuation closes over part of the dynamic environment, rather than all or none of it; reinstating the captured continuation supplements the dynamic environment, rather than replacing or inheriting it. We introduce a type- and reduction-preserving translation from DB + DC to DC, which proves that delimited control macro-expresses dynamic binding. We use this translation to implement DB + DC in Scheme, OCaml, and Haskell. We extend DB + DC with mutable dynamic variables and a facility to obtain not only the latest binding of a dynamic variable but also older bindings. This facility provides for stack inspection and (more generally) folding over the execution context as an inductive data structure.
The Theory of Fexprs is Trivial
, 1998
"... . We provide a very simple model of a reflective facility based on the pure -calculus, and we show that its theory of contextual equivalence is trivial: two terms in the language are contextually equivalent iff they are ff-congruent. 1. Introduction The thesis of much of programming language seman ..."
Abstract
-
Cited by 18 (0 self)
- Add to MetaCart
. We provide a very simple model of a reflective facility based on the pure -calculus, and we show that its theory of contextual equivalence is trivial: two terms in the language are contextually equivalent iff they are ff-congruent. 1. Introduction The thesis of much of programming language semantics is that the fundamental question about a programming language is its notion of contextual equivalence: which pairs of phrases (M; N) have the property that M and N may be freely substituted for each other in any program context, without changing the behavior of the resulting program [10, 14]. This is a key notion because, for example, any source-to-source optimization in a compiler (except possibly for a whole-program transformation) should produce a term contextually equivalent to the original. In this note, we provide a very simple model of a reflective facility based on the pure -calculus, and we show that its theory of contextual equivalence is trivial: two terms in the language ar...
Duplication and Partial Evaluation -- For a Better Understanding of Reflective Languages
, 1996
"... This paper presents a general implementation framework for reflective languages. It allows us to systematically build reflective languages which have the following favorable properties: (1) user programs are allowed to access and change (parts of) metalevel interpreters, (2) reflective facilities a ..."
Abstract
-
Cited by 13 (6 self)
- Add to MetaCart
This paper presents a general implementation framework for reflective languages. It allows us to systematically build reflective languages which have the following favorable properties: (1) user programs are allowed to access and change (parts of) metalevel interpreters, (2) reflective facilities are available at every level, (hence there exists conceptually an infinite tower of interpreters), and (3) the interpreter runs as efficiently as the conventional (directly implemented) metacircular interpreter when reflection is not used. Our scheme is divided into three stages. First, we define interpreters which give the operational semantics of each level, and conceptually construct the infinite tower of these interpreters. They are then duplicated to obtain directly executed interpreters, while introducing double interpretation to maintain redefinability of interpreters. Finally, partial evaluation is employed to collapse the double interpretation into single interpretation. We illustrate our scheme by implementing a particular reflective language called Black in Scheme, but it is general enough to be applied to other reflective languages. The paper gives the complete Scheme implementation of Black and demonstrates some examples. We also show how a system with the delta abstraction introduced by Blond can be constructed in our framework.

