FACTOID # 32: Guatamalan women work 11.5 hours a day, while South African men work only 4.5.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RELATED ARTICLES
People who viewed "Continuation" also viewed:
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Continuation

In computing, a continuation is a representation of some of the execution state of a program (often the call stack and the current Instruction pointer) at a certain point. Many languages have constructs that allow a programmer to save that execution state into an object, and then restore the state from this object at a later point in time (thereby resuming its execution). This technique has been used in functional programming, imperative programming, and message passing programming. Memory (Random Access Memory) Look up computing in Wiktionary, the free dictionary. ... In computer science, a call stack is a special stack which stores information about the active subroutines of a computer program. ... The program counter (also called the instruction pointer in some computers) is a register in a computer processor which indicates where the computer is in its instruction sequence. ... Functional programming is a programming paradigm that conceives computation as the evaluation of mathematical functions and avoids state and mutable data. ... In computer science, imperative programming, as opposed to declarative programming, is a programming paradigm that describes computation in terms of a program state and statements that change the program state. ... In computer science, message passing programming, as opposed to imperative programming, is a programming paradigm that describes computation in terms of communicating messages among senders and recipients that have local state as opposed to operations that change a global state. ...


Continuations are also used in models of computation including the Actor model, process calculi, and the lambda calculus. Steve Russell invented the continuation in his second LISP implementation for the IBM 704, though he did not name it. Christopher Strachey, Christopher F. Wadsworth and John C. Reynolds brought the term continuation into prominence in their work in the field of denotational semantics that makes extensive use of continuations to allow sequential programs to be analysed in terms of functional programming semantics. In computer science, the Actor model is a mathematical model of concurrent computation that treats actors as the universal primitives of concurrent digital computation: in response to a message that it receives, an actor can make local decisions, create more actors, send more messages, and determine how to respond to... The process calculi (or process algebras) are a diverse family of related approaches to formally modelling concurrent systems. ... The lambda calculus is a formal system designed to investigate function definition, function application, and recursion. ... Steve Russel created the first videogame, Spacewar at the Tech Model Railroad Club at the MIT. Categories: Substubs ... For the programming language, see Lisp (programming language). ... The IBM 704, the first mass-produced computer with floating point arithmetic hardware, was introduced by IBM in April, 1956. ... Christopher Strachey (1916–1975) was a British computer scientist. ... John C. Reynolds is a American computer scientist (born June 1, 1935). ... In computer science, denotational semantics is an approach to formalizing the semantics of computer systems by constructing mathematical objects (called denotations or meanings) which express the semantics of these systems. ... Functional programming is a programming paradigm that conceives computation as the evaluation of mathematical functions and avoids state and mutable data. ...

Contents

Example

In Scheme: Scheme is a multi-paradigm programming language. ...

 (define theContinuation #f) (define (test) (let ((i 0)) ; call/cc calls its first function argument, passing ; a continuation variable representing this point in ; the program as the argument to that function. ; ; In this case, the function argument assigns that ; continuation to the variable theContinuation. ; (call/cc (lambda (k) (set! theContinuation k))) ; ; The next time theContinuation is called, we start here. (set! i (+ i 1)) i))  

Defines a function test that sets theContinuation to the future execution state of itself:

 > (test) 1 > (theContinuation) 2 > (theContinuation) 3 > (define anotherContinuation theContinuation) > (test) 1 > (theContinuation) 2 > (anotherContinuation) 4  

Another call with current continuation example:

  (define my-abortable-procedure (lambda (escape-procedure) ; Do stuff (+ 1 1) ;nonlocal return (escape-procedure 'SOMEVALUE) (display 'NEVER-REACHED-WHEN-ESCAPE-IS-CALLED))) (display (call/cc my-abortable-procedure)) ; displays: SOMEVALUE ; The return value of call/cc is the value either returned by my-abortable-procedure or ; the value passed to escape-procedure  

Continuations in Web development

One area that has seen practical use of continuations is in Web programming.[1][2] Three of the most popular continuation-aware Web servers are the PLT Scheme Web Server, the UnCommon Web Framework for Common Lisp, and the Seaside Web Server for Smalltalk. The Apache Cocoon Web application framework also provides continuations (see the Cocoon manual). It has been suggested that this article or section be merged with web application development. ... The inside/front of a Dell PowerEdge web server The term Web server can mean one of two things: A computer that is responsible for accepting HTTP requests from clients, which are known as Web browsers, and serving them HTTP responses along with optional data contents, which usually are Web... Common Lisp, commonly abbreviated CL, is a dialect of the Lisp programming language, standardised by ANSI X3. ... For other uses, see Small Talk (disambiguation). ... Apache Cocoon, often just called Cocoon, is a web development framework built around the concepts of separation of concerns and component-based web development. ... A web application framework is a software framework that is designed to support the development of dynamic websites, Web applications and Web services. ...


However, there is no consensus yet as to whether continuations are harmful or beneficial for Web programming.


Programming language support

Many programming languages exhibit such a feature under various names; specifically:

In any language which supports closures, it is possible to write programs in continuation passing style and manually implement call/cc. This is a particularly common strategy in Haskell, where it is easy to construct a "continuation passing monad". C is a general-purpose, block structured, procedural, imperative computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system. ... setcontext is one of a family of C library functions (the others being getcontext, makecontext and swapcontext) used for context control. ... It has been suggested that Traditional Unix be merged into this article or section. ... GNU (pronounced ) is a computer operating system composed entirely of free software. ... Factor is a concatenative programming language designed and implemented by Slava Pestov. ... Parrot is a register-based virtual machine being developed using the C programming language and intended to run dynamic languages efficiently. ... Continuation passing style (CPS) is a term used within functional programming to describe a style of programming wherein functions never return. ... Rhino is an open source JavaScript engine. ... Ruby is a reflective, object-oriented programming language. ... Scheme is a multi-paradigm programming language. ... This page is about the computer science continuation. ... Smalltalk is a dynamically typed object oriented programming language designed at Xerox PARC by Alan Kay, Dan Ingalls, Ted Kaehler, Adele Goldberg, and others during the 1970s. ... SML (Standard ML) is a general-purpose, modular, functional programming language with compile-time type checking and type inference. ... Unlambda is a minimal functional programming language based on combinatory logic, a version of the lambda calculus that omits the lambda operator. ... Pico is a programming language developed at the PROG lab at the Vrije Universiteit Brussel. ... In programming languages, a closure is a function that refers to free variables in its lexical context. ... Continuation passing style (CPS) is a term used within functional programming to describe a style of programming wherein functions never return. ... Haskell is a standardized purely functional programming language with non-strict semantics, named after the logician Haskell Curry. ... In computer science, monads are used to express sequential composition under the functional programming paradigm. ...


Kinds of continuations

Support for continuations varies widely. A programming language supports re-invocable continuations if a continuation may be invoked repeatedly (even after it has already returned). Re-invocable continuations were introduced by Peter J. Landin using his J (for Jump) operator that could transfer the flow of control back into the middle of a procedure invocation. Re-invocable continuations have also been called "re-entrant" in the MzScheme programming language. However this use of the term "re-entrant" is too easily confused with its use in discussions of multithreading. Peter Landin is a British computer scientist. ... PLT Scheme is an umbrella name for a family of implementations of the Scheme programming language. ... For the form of code consisting entirely of subroutine calls, see Threaded code. ...


At one time Gerry Sussman and Drew McDermott thought that using re-invocable continuations (which they called "Hairy Control Structure") was the solution to the AI control structure problems that had originated in Planner. Carl Hewitt et al. developed message passing as an alternative solution in the Actor model. Guy Steele and Gerry Sussman then developed the continuations in Scheme in their attempt to understand the Actor model. Gerald Jay Sussman is the Matsushita Professor of Electrical Engineering at the Massachusetts Institute of Technology(MIT). ... Drew McDermott is a Professor of Computer Science at Yale University. ... Planner (often seen in publications as PLANNER) is a programming language designed by Carl Hewitt at MIT, and first published in 1969. ... Carl E. Hewitt is an Associate Professor (Emeritus) in the Electrical Engineering and Computer Science department at the Massachusetts Institute of Technology (MIT). ... In computer science, the Actor model is a mathematical model of concurrent computation that treats actors as the universal primitives of concurrent digital computation: in response to a message that it receives, an actor can make local decisions, create more actors, send more messages, and determine how to respond to... Guy Lewis Steele, Jr. ... Gerald Jay Sussman is the Matsushita Professor of Electrical Engineering at the Massachusetts Institute of Technology(MIT). ... Scheme is a multi-paradigm programming language. ...


A more limited kind is the escape continuation that may be used to escape the current context to a surrounding one. Many languages which do not explicitly support continuations support exception handling, which is equivalent to escape continuations and can be used for the same purposes. C's setjmp/longjmp are also equivalent: they can only be used to unwind the stack. Escape continuations can also be used to implement tail-call optimization. Exception handling is a programming language construct or computer hardware mechanism designed to handle the occurrence of some condition that changes the normal flow of execution. ... The source is licensed under the GFDL, but has large invariant sections and cover texts. ... In computer science, tail recursion is a special case of recursion that can be easily transformed into an iteration. ...


Disadvantages

Continuations are the functional expression of the GOTO statement, and the same caveats apply.[citation needed] While many believe that they are a sensible option in some special cases such as web programming, use of continuations can result in code that is difficult to follow. In fact, the esoteric programming language Unlambda includes call-with-current-continuation as one of its features solely because of its resistance to understanding. The external links below illustrate the concept in more detail. GOTO is a statement found in many computer programming languages. ... An esoteric programming language (sometimes shortened to esolang[1]) is a programming language designed as a test of the boundaries of computer programming language design, as a proof of concept, or as a joke. ... Unlambda is a minimal functional programming language based on combinatory logic, a version of the lambda calculus that omits the lambda operator. ... This page is about the computer science continuation. ...


Linguistics

Some phenomena in natural languages can be grasped using the notion of continuation. See Chris Barker's paper Continuations in Natural Language for details. See also Montague grammar. Montague grammar is an approach to natural language semantics, based on formal logic, especially lambda calculus and set theory. ...


See also

In programming languages, a closure is a function that refers to free variables in its lexical context. ... In computer programming, COMEFROM is a control flow structure used in some programming languages. ... Continuation passing style (CPS) is a term used within functional programming to describe a style of programming wherein functions never return. ... In computer science control flow (or alternatively, flow of control) refers to the order in which the individual statements or instructions of an imperative program are performed or executed. ... In computer science, coroutines are program components that generalize subroutines to allow multiple entry points and suspending and resuming of execution at certain locations. ... In computer science, denotational semantics is an approach to formalizing the semantics of computer systems by constructing mathematical objects (called denotations or meanings) which express the semantics of these systems. ... GOTO is a statement found in many computer programming languages. ... A spaghetti stack is in fact an N-ary tree data structure in which child nodes have pointers to the parent nodes. ...

External links

RIFE is a full-stack open source Java web application framework with tools and APIs to implement most common web features. ... RIFE is a full-stack open source Java web application framework with tools and APIs to implement most common web features. ...

References

  • Peter Landin. A Generalization of Jumps and Labels Report. UNIVAC Systems Programming Research. August 1965. Reprinted in Higher Order and Symbolic Computation, 11(2):125-143, 1998, with a foreword by Hayo Thielecke.
  • Drew McDermott and Gerry Sussman. The Conniver Reference Manual MIT AI Memo 259. May 1972.
  • Daniel Bobrow: A Model for Control Structures for Artificial Intelligence Programming Languages IJCAI 1973.
  • Carl Hewitt, Peter Bishop and Richard Steiger. A Universal Modular Actor Formalism for Artificial Intelligence IJCAI 1973.
  • Christopher Strachey and Christopher P. Wadsworth. Continuations: a Mathematical semantics for handling full jumps Technical Monograph PRG-11. Oxford University Computing Laboratory. January 1974. Reprinted in Higher Order and Symbolic Computation, 13(1/2):135--152, 2000, with a foreword by Christopher P. Wadsworth.
  • John Reynolds. Definitional Interpreters for Higher-Order Programming Languages Proceedings of 25th ACM National Conference, pp. 717-740, 1972. Reprinted in Higher-Order and Symbolic Computation 11(4):363-397, 1998, with a foreword.
  • John Reynolds. On the Relation between Direct and Continuation Semantics Proceedings of Second Colloquium on Automata, Languages, and Programming. LNCS Vol. 14, pp. 141-156, 1974.
  • Gerald Sussman and Guy Steele. SCHEME: An Interpreter for Extended Lambda Calculus AI Memo 349, MIT Artificial Intelligence Laboratory, Cambridge, Massachusetts, December 1975. Reprinted in Higher-Order and Symbolic Computation 11(4):405-439, 1998, with a foreword.
  • Robert Hieb, R. Kent Dybvig, Carl Bruggeman. Representing Control in the Presence of First-Class Continuations Proceedings of the ACM SIGPLAN '90 Conference on Programming Language Design and Implementation, pp. 66-77.
  • Will Clinger, Anne Hartheimer, Eric Ost. Implementation Strategies for Continuations Proceedings of the 1988 ACM conference on LISP and Functional Programming, pp. 124-131, 1988. Journal version: Higher-Order and Symbolic Computation, 12(1):7-45, 1999.

  Results from FactBites:
 
Bamboo - Continuous Integration and Build Server (161 words)
More than a conventional continuous integration (CI) server, Bamboo provides Build Telemetry to help identify and highlight trends, patterns, and linkages across builds — not just focusing on the results of a single build.
Continuous improvement in the health of your projects with advanced continuous integration features.
Instant feedback via a range of notification and personalisation options to suit the way you work.
Continuous Integration (7442 words)
Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day.
Continuous Integration assumes a high degree of tests which are automated into the software: a facility I call self-testing code.
Continuous Integration is all about communication, so you want to ensure that everyone can easily see the state of the system and the changes that have been made to it.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.