Results 1 - 10
of
18
A Generic Account of Continuation-Passing Styles
- Proceedings of the Twenty-first Annual ACM Symposium on Principles of Programming Languages
, 1994
"... We unify previous work on the continuation-passing style (CPS) transformations in a generic framework based on Moggi's computational meta-language. This framework is used to obtain CPS transformations for a variety of evaluation strategies and to characterize the corresponding administrative reducti ..."
Abstract
-
Cited by 79 (33 self)
- Add to MetaCart
We unify previous work on the continuation-passing style (CPS) transformations in a generic framework based on Moggi's computational meta-language. This framework is used to obtain CPS transformations for a variety of evaluation strategies and to characterize the corresponding administrative reductions and inverse transformations. We establish generic formal connections between operational semantics and equational theories. Formal properties of transformations for specific evaluation orders follow as corollaries. Essentially, we factor transformations through Moggi's computational meta-language. Mapping -terms into the meta-language captures computational properties (e.g., partiality, strictness) and evaluation order explicitly in both the term and the type structure of the meta-language. The CPS transformation is then obtained by applying a generic transformation from terms and types in the meta-language to CPS terms and types, based on a typed term representation of the continuation ...
Scheme: An interpreter for extended lambda calculus
- MEMO 349, MIT AI LAB
, 1975
"... Inspired by ACTORS [7, 17], we have implemented an interpreter for a LISP-like language, SCHEME, based on the lambda calculus [2], but extended for side effects, multiprocessing, and process synchronization. The purpose of this implementation is tutorial. We wish to: 1. alleviate the confusion cause ..."
Abstract
-
Cited by 64 (2 self)
- Add to MetaCart
Inspired by ACTORS [7, 17], we have implemented an interpreter for a LISP-like language, SCHEME, based on the lambda calculus [2], but extended for side effects, multiprocessing, and process synchronization. The purpose of this implementation is tutorial. We wish to: 1. alleviate the confusion caused by Micro-PLANNER, CONNIVER, etc., by clarifying the embedding of non-recursive control structures in a recursive host language like LISP. 2. explain how to use these control structures, independent of such issues as pattern matching and data base manipulation. 3. have a simple concrete experimental domain for certain issues of programming semantics and style. This paper is organized into sections. The first section is a short “reference manual ” containing specifications for all the unusual features of SCHEME. Next, we present a sequence of programming examples which illustrate various programming styles, and how to use them. This will raise certain issues of semantics which we will try to clarify with lambda calculus in the third section. In the fourth section we will give a general discussion of the issues facing an implementor of an interpreter for a language based on lambda calculus. Finally, we will present a completely annotated interpreter for SCHEME, written in MacLISP [13], to acquaint programmers with the tricks of the trade of implementing non-recursive control structures in a recursive language like LISP.
CPS Transformation after Strictness Analysis
- ACM Letters on Programming Languages and Systems
, 1993
"... syntax of the source language ` c : ' f:::; x : ø ; :::g ` x : ø ß ` e : ø !ø ß ` fix e : ø ß [ fx : ø 1 g ` e : ø 2 ß ` x : ø 1 : e : ø 1 !ø 2 ß ` e 0 : ø 1 !ø 2 ß ` e 1 : ø 1 ß ` @ e 0 e 1 : ø 2 ß ` e 1 : ' ß ` e 2 : ø ß ` e 3 : ø ß ` if e 1 then e 2 else e 3 : ø ß ` e 0 : ø 0 ß [ fx : ø 0 g ` ..."
Abstract
-
Cited by 26 (10 self)
- Add to MetaCart
syntax of the source language ` c : ' f:::; x : ø ; :::g ` x : ø ß ` e : ø !ø ß ` fix e : ø ß [ fx : ø 1 g ` e : ø 2 ß ` x : ø 1 : e : ø 1 !ø 2 ß ` e 0 : ø 1 !ø 2 ß ` e 1 : ø 1 ß ` @ e 0 e 1 : ø 2 ß ` e 1 : ' ß ` e 2 : ø ß ` e 3 : ø ß ` if e 1 then e 2 else e 3 : ø ß ` e 0 : ø 0 ß [ fx : ø 0 g ` e 1 : ø 1 ß ` let x = e 0 in e 1 : ø 1 ß ` e 1 : ø 1 ß ` e 2 : ø 2 ß ` pair e 1 e 2 : ø 1 \Theta ø 2 ß ` e : ø 1 \Theta ø 2 ß ` fst e : ø 1 ß ` e : ø 1 \Theta ø 2 ß ` snd e : ø 2 Fig. 2. Type-checking rules for the source language approach is used by Kesley and Hudak [11] and by Fradet and Le M'etayer [9]. Both include a CPS transformation. Fradet and Le M'etayer compile both CBN and CBV programs by using the CBN and the CBV CPS-transformation. Recently, Burn and Le M'etayer have combined this technique with a global programanalysis [2], which is comparable to our goal here. 1.4 Overview Section 2 presents the syntax of the source language and the strictness-annotated language. We c...
Lazy rewriting on eager machinery
- ACM Transactions on Programming Languages and Systems
, 2000
"... The article introduces a novel notion of lazy rewriting. By annotating argument positions as lazy, redundant rewrite steps are avoided, and the termination behaviour of a term rewriting system can be improved. Some transformations of rewrite rules enable an implementation using the same primitives a ..."
Abstract
-
Cited by 23 (1 self)
- Add to MetaCart
The article introduces a novel notion of lazy rewriting. By annotating argument positions as lazy, redundant rewrite steps are avoided, and the termination behaviour of a term rewriting system can be improved. Some transformations of rewrite rules enable an implementation using the same primitives as an implementation of eager rewriting. 1
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
Thunks and the λ-calculus
- IN THE JOURNAL OF FUNCTIONAL PROGRAMMING. RS-97-6 OLIVIER DANVY AND ULRIK
, 1997
"... Plotkin, in his seminal article Call-by-name, call-by-value and the λ-calculus, formalized evaluation strategies and simulations using operational semantics and continuations. In particular, he showed how call-by-name evaluation could be simulated under call-by-value evaluation and vice versa. Si ..."
Abstract
-
Cited by 21 (9 self)
- Add to MetaCart
Plotkin, in his seminal article Call-by-name, call-by-value and the λ-calculus, formalized evaluation strategies and simulations using operational semantics and continuations. In particular, he showed how call-by-name evaluation could be simulated under call-by-value evaluation and vice versa. Since Algol 60, however, call-by-name is both implemented and simulated with thunks rather than with continuations. We recast
Linguistic Side Effects
- In Proceedings of the Eighteenth Annual IEEE Symposium on Logic and Computer Science (LICS 2003) Workshop on Logic and Computational
, 2003
"... Making linguistic theory is like specifying a programming language... ..."
Abstract
-
Cited by 11 (4 self)
- Add to MetaCart
Making linguistic theory is like specifying a programming language...
Thunks (continued)
- Kansas State University
, 1992
"... : Call-by-name can be simulated in a call-by-value setting using "thunks" (i.e., parameterless procedures) or continuation-passing-style (CPS). In this paper we uncover a relationship between the two simulations. We prove that the call-by-value CPS transformation Cv , when applied to a term T (t) wh ..."
Abstract
-
Cited by 8 (2 self)
- Add to MetaCart
: Call-by-name can be simulated in a call-by-value setting using "thunks" (i.e., parameterless procedures) or continuation-passing-style (CPS). In this paper we uncover a relationship between the two simulations. We prove that the call-by-value CPS transformation Cv , when applied to a term T (t) which simulates call-by-name using thunks, yields a term identical to the call-by-name CPS transformation Cn applied directly to t (modulo renaming): Cv ffi T j Cn This result sheds new light on the call-by-name CPS transformation --- it can be factored into two conceptually distinct steps: ffl the suspension of argument evaluation (captured in T ); ffl the sequentialization of function application to give the usual tail-calls of CPS terms (captured in Cv ). Keywords: -calculus, call-by-name, call-by-value, continuation-passing style transformation. 1. Introduction Among many possible implementations of call-by-name in Algol 60, one still stands the test of time: Ingerman's "thunks" [8]. A...
Ackermann’s Function: A Study in the Efficiency of Calling Procedures
- BIT
, 1976
"... A six line recursive procedure is used to assess the efficiency of the procedure calling mechanism in ALGOL-like languages. The results from some 40 systems varying from ALGOL 68 and PL/I to System Implementation Languages for minicomputers are presented and compared. A hundred to one variation in p ..."
Abstract
-
Cited by 6 (2 self)
- Add to MetaCart
A six line recursive procedure is used to assess the efficiency of the procedure calling mechanism in ALGOL-like languages. The results from some 40 systems varying from ALGOL 68 and PL/I to System Implementation Languages for minicomputers are presented and compared. A hundred to one variation in performance occurs with this test, the major reasons for which are given.

