There is one abstraction that can be used to implement such apparently diverse concepts as exceptions, generators, coroutines and even the backtracking mechanism present in Prolog.
This article demonstrates how to use continuations to implement these constructs in a custom, small programming language. Then the implementation of an interpreter for that language is presented.
Finally a Java servlet is demonstrated. It uses continuations with server-side JavaScript to simplify writing complex workflows that hide the request/response cycle of HTTP.
Your new post is loading...